+# Repository management
.svn
-*~
+
+# Editors
*.kate-swp
+*~
.*.swp
-.classpath
-.idea
-.metadata*
.project
-.settings
-AdminSettings.php
-LocalSettings.php
-StartProfiler.php
cscope.files
cscope.out
-favicon.ico
+## NetBeans
nbproject*
project.index
-static*
-tags
+
+# MediaWiki install & usage
cache/*.cdb
images/[0-9a-f]
images/archive
images/deleted
images/temp
images/thumb
+## Extension:EasyTimeline
images/timeline
images/tmp
-maintenance/dev/data
maintenance/.mweval_history
maintenance/.mwsql_history
+maintenance/dev/data
+AdminSettings.php
+LocalSettings.php
+StartProfiler.php
+
+# Operating systems
+## Mac OS X
+.DS_Store
+
+# Misc
+.classpath
+.idea
+.metadata*
+.settings
+favicon.ico
+static*
+tags
* The user right 'upload_by_url' is no longer given to sysops by default.
This only affects installations which have $wgAllowCopyUploads set to true.
* Removed f-prot support from $wgAntivirusSetup.
-* $wgDBerrorLogInUTC to log error in $wgDBerrorLog using an UTC date instead
- of the wiki timezone set by $wgLocalTimezone.
+* New variable $wgDBerrorLogTZ to provide dates in the error log in a
+ different timezone than the wiki timezone set by $wgLocalTimezone.
=== New features in 1.20 ===
* Added TitleIsAlwaysKnown hook which gets called when determining if a page exists.
* Session storage can now configured independently of general object cache
storage, by using $wgSessionCacheType. $wgSessionsInMemcached has been
renamed to $wgSessionsInObjectCache, with the old name retained for backwards
- compatibility.
+ compatibility. When this feature is enabled, the expiry time can now be
+ configured with $wgObjectCacheSessionExpiry.
* Implemented mw.user.getGroups for getting and caching user groups.
* (bug 37830) Added $wgRequirePasswordforEmailChange to control whether password
confirmation is required for changing an email address or not.
so the WikiPage code wasn't useful there either.
* Deprecated mw.user.name in favour of mw.user.getName.
* Deprecated mw.user.anonymous in favour of mw.user.isAnon.
+* Deprecated DatabaseBase functions newFromParams(), newFromType(), set(),
+ quote_ident(), and escapeLike() were removed.
== Compatibility ==
/** File to log database errors to */
$wgDBerrorLog = false;
+
/**
- * Override wiki timezone to UTC for wgDBerrorLog
+ * Timezone to use in the error log.
+ * Defaults to the wiki timezone ($wgLocalTimezone).
+ *
+ * A list of useable timezones can found at:
+ * http://php.net/manual/en/timezones.php
+ *
+ * @par Examples:
+ * @code
+ * $wgLocaltimezone = 'UTC';
+ * $wgLocaltimezone = 'GMT';
+ * $wgLocaltimezone = 'PST8PDT';
+ * $wgLocaltimezone = 'Europe/Sweden';
+ * $wgLocaltimezone = 'CET';
+ * @endcode
+ *
* @since 1.20
*/
-$wgDBerrorLogInUTC = false;
+$wgDBerrorLogTZ = false;
/** When to give an error message */
$wgDBClusterTimeout = 10;
*/
$wgSessionsInObjectCache = false;
+/**
+ * The expiry time to use for session storage when $wgSessionsInObjectCache is
+ * enabled, in seconds.
+ */
+$wgObjectCacheSessionExpiry = 3600;
+
/**
* This is used for setting php's session.save_handler. In practice, you will
* almost never need to change this ever. Other options might be 'user' or
* Timezones can be translated by editing MediaWiki messages of type
* timezone-nameinlowercase like timezone-utc.
*
+ * A list of useable timezones can found at:
+ * http://php.net/manual/en/timezones.php
+ *
* @par Examples:
* @code
+ * $wgLocaltimezone = 'UTC';
* $wgLocaltimezone = 'GMT';
* $wgLocaltimezone = 'PST8PDT';
* $wgLocaltimezone = 'Europe/Sweden';
* @param $text String: database error message.
*/
function wfLogDBError( $text ) {
- global $wgDBerrorLog, $wgDBerrorLogInUTC;
+ global $wgDBerrorLog, $wgDBerrorLogTZ;
+ static $logDBErrorTimeZoneObject = null;
+
if ( $wgDBerrorLog ) {
$host = wfHostname();
$wiki = wfWikiID();
- if( $wgDBerrorLogInUTC ) {
- $wikiTimezone = date_default_timezone_get();
- date_default_timezone_set( 'UTC' );
- }
- $date = date( 'D M j G:i:s T Y' );
- if( $wgDBerrorLogInUTC ) {
- // Restore timezone
- date_default_timezone_set( $wikiTimezone );
+ if ( $wgDBerrorLogTZ && !$logDBErrorTimeZoneObject ) {
+ $logDBErrorTimeZoneObject = new DateTimeZone( $wgDBerrorLogTZ );
}
+ $d = date_create( "now", $logDBErrorTimeZoneObject );
+
+ $date = $d->format( 'D M j G:i:s T Y' );
+
$text = "$date\t$host\t$wiki\t$text";
wfErrorLog( $text, $wgDBerrorLog );
}
* Initialises this object with an ID
*
* @param $id
+ * @throws MWException
*/
function load( $id ) {
global $wgContLang;
var $baseRegex, $regex;
var $matches;
+ /**
+ * @param $names array
+ */
function __construct( $names = array() ) {
$this->names = $names;
}
return $newRegex;
}
+ /**
+ * @since 1.20
+ * @return array
+ */
+ public function getNames() {
+ return $this->names;
+ }
+
/**
* Parse a match array from preg_match
* Returns array(magic word ID, parameter value)
*
* @param $m array
*
+ * @throws MWException
* @return array
*/
function parseMatch( $m ) {
$regexes = $this->getVariableStartToEndRegex();
foreach ( $regexes as $regex ) {
if ( $regex !== '' ) {
- $m = false;
+ $m = array();
if ( preg_match( $regex, $text, $m ) ) {
return $this->parseMatch( $m );
}
/**
* Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader,
* such as Accept-Encoding or Cookie
- *
+ *
* @return String
*/
public function getVaryHeader() {
* Add a "return to" link pointing to a specified title
*
* @param $title Title to link
- * @param $query String query string
+ * @param $query Array query string parameters
* @param $text String text of the link (input is not escaped)
*/
public function addReturnTo( $title, $query = array(), $text = null ) {
$titleObj = Title::newMainPage();
}
- $this->addReturnTo( $titleObj, $returntoquery );
+ $this->addReturnTo( $titleObj, wfCgiToArray( $returntoquery ) );
}
/**
if ( wfRunHooks( 'AbortEmailNotification', array($editor, $title) ) ) {
# @todo FIXME: This would be better as an extension hook
$enotif = new EmailNotification();
- $status = $enotif->notifyOnPageChange( $editor, $title,
+ $enotif->notifyOnPageChange( $editor, $title,
$this->mAttribs['rc_timestamp'],
$this->mAttribs['rc_comment'],
$this->mAttribs['rc_minor'],
protected $mTitle;
protected $mCurrent;
+ // Revision deletion constants
const DELETED_TEXT = 1;
const DELETED_COMMENT = 2;
const DELETED_USER = 4;
const DELETED_RESTRICTED = 8;
- // Convenience field
- const SUPPRESSED_USER = 12;
+ const SUPPRESSED_USER = 12; // convenience
+
// Audience options for accessors
const FOR_PUBLIC = 1;
const FOR_THIS_USER = 2;
* Returns null if no such revision can be found.
*
* $flags include:
- * IDBAccessObject::LATEST_READ : Select the data from the master
- * IDBAccessObject::LOCKING_READ : Select & lock the data from the master
- * IDBAccessObject::AVOID_MASTER : Avoid master queries; data may be stale
+ * Revision::READ_LATEST : Select the data from the master
+ * Revision::READ_LOCKING : Select & lock the data from the master
*
* @param $id Integer
* @param $flags Integer (optional)
* to that title, will return null.
*
* $flags include:
- * IDBAccessObject::LATEST_READ : Select the data from the master
- * IDBAccessObject::LOCKING_READ : Select & lock the data from the master
- * IDBAccessObject::AVOID_MASTER : Avoid master queries; data may be stale
+ * Revision::READ_LATEST : Select the data from the master
+ * Revision::READ_LOCKING : Select & lock the data from the master
*
* @param $title Title
* @param $id Integer (optional)
* @param $flags Integer Bitfield (optional)
* @return Revision or null
*/
- public static function newFromTitle( $title, $id = 0, $flags = 0 ) {
+ public static function newFromTitle( $title, $id = 0, $flags = null ) {
$conds = array(
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey()
if ( $id ) {
// Use the specified ID
$conds['rev_id'] = $id;
- } elseif ( !( $flags & self::AVOID_MASTER ) && wfGetLB()->getServerCount() > 1 ) {
- // Get the latest revision ID from the master
- $dbw = wfGetDB( DB_MASTER );
- $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ );
- if ( $latest === false ) {
- return null; // page does not exist
- }
- $conds['rev_id'] = $latest;
} else {
// Use a join to get the latest revision
$conds[] = 'rev_id=page_latest';
+ // Callers assume this will be up-to-date
+ $flags = is_int( $flags ) ? $flags : self::READ_LATEST; // b/c
}
- return self::newFromConds( $conds, $flags );
+ return self::newFromConds( $conds, (int)$flags );
}
/**
* Returns null if no such revision can be found.
*
* $flags include:
- * IDBAccessObject::LATEST_READ : Select the data from the master
- * IDBAccessObject::LOCKING_READ : Select & lock the data from the master
- * IDBAccessObject::AVOID_MASTER : Avoid master queries; data may be stale
+ * Revision::READ_LATEST : Select the data from the master
+ * Revision::READ_LOCKING : Select & lock the data from the master
*
* @param $revId Integer
* @param $pageId Integer (optional)
* @param $flags Integer Bitfield (optional)
* @return Revision or null
*/
- public static function newFromPageId( $pageId, $revId = 0, $flags = 0 ) {
+ public static function newFromPageId( $pageId, $revId = 0, $flags = null ) {
$conds = array( 'page_id' => $pageId );
if ( $revId ) {
$conds['rev_id'] = $revId;
- } elseif ( !( $flags & self::AVOID_MASTER ) && wfGetLB()->getServerCount() > 1 ) {
- // Get the latest revision ID from the master
- $dbw = wfGetDB( DB_MASTER );
- $latest = $dbw->selectField( 'page', 'page_latest', $conds, __METHOD__ );
- if ( $latest === false ) {
- return null; // page does not exist
- }
- $conds['rev_id'] = $latest;
} else {
+ // Use a join to get the latest revision
$conds[] = 'rev_id = page_latest';
+ // Callers assume this will be up-to-date
+ $flags = is_int( $flags ) ? $flags : self::READ_LATEST; // b/c
}
- return self::newFromConds( $conds, $flags );
+ return self::newFromConds( $conds, (int)$flags );
}
/**
* @return Revision or null
*/
private static function newFromConds( $conditions, $flags = 0 ) {
- $db = wfGetDB( ( $flags & self::LATEST_READ ) ? DB_MASTER : DB_SLAVE );
+ $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_SLAVE );
$rev = self::loadFromConds( $db, $conditions, $flags );
if ( is_null( $rev ) && wfGetLB()->getServerCount() > 1 ) {
- if ( !( $flags & self::LATEST_READ ) && !( $flags & self::AVOID_MASTER ) ) {
+ if ( !( $flags & self::READ_LATEST ) ) {
$dbw = wfGetDB( DB_MASTER );
$rev = self::loadFromConds( $dbw, $conditions, $flags );
}
self::selectUserFields()
);
$options = array( 'LIMIT' => 1 );
- if ( $flags & self::FOR_UPDATE ) {
+ if ( $flags & self::READ_LOCKING ) {
$options[] = 'FOR UPDATE';
}
return $db->select(
}
return $wgValidSkinNames;
}
-
+
/**
* Fetch the skinname messages for available skins.
* @return array of strings
$ntl = '';
if ( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {
- $userTitle = $this->getUser()->getUserPage();
- $userTalkTitle = $userTitle->getTalkPage();
+ $userTalkTitle = $this->getUser()->getTalkPage();
if ( !$userTalkTitle->equals( $out->getTitle() ) ) {
+ $lastSeenRev = isset( $newtalks[0]['rev'] ) ? $newtalks[0]['rev'] : null;
+ $nofAuthors = 0;
+ if ( $lastSeenRev !== null ) {
+ $plural = true; // Default if we have a last seen revision: if unknown, use plural
+ $latestRev = Revision::newFromTitle ($userTalkTitle);
+ if ( $latestRev !== null ) {
+ // Singular if only 1 unseen revision, plural if several unseen revisions.\r
+ $plural = $latestRev->getParentId() !== $lastSeenRev->getId();\r
+ $nofAuthors = $userTalkTitle->countAuthorsBetween( $lastSeenRev, $latestRev, 10, 'include_new' );
+ }
+ } else {
+ // Singular if no revision -> diff link will show latest change only in any case
+ $plural = false;
+ }
+ $plural = $plural ? 2 : 1;
+ // 2 signifies "more than one revision". We don't know how many, and even if we did,
+ // the number of revisions or authors is not necessarily the same as the number of
+ // "messages".
$newMessagesLink = Linker::linkKnown(
$userTalkTitle,
- $this->msg( 'newmessageslink' )->escaped(),
+ $this->msg( 'newmessageslinkplural' )->params( $plural )->escaped(),
array(),
array( 'redirect' => 'no' )
);
$newMessagesDiffLink = Linker::linkKnown(
$userTalkTitle,
- $this->msg( 'newmessagesdifflink' )->escaped(),
+ $this->msg( 'newmessagesdifflinkplural' )->params( $plural )->escaped(),
array(),
- array( 'diff' => 'cur' )
+ $lastSeenRev !== null
+ ? array( 'oldid' => $lastSeenRev->getId(), 'diff' => 'cur' )
+ : array( 'diff' => 'cur' )
);
- $ntl = $this->msg(
- 'youhavenewmessages',
- $newMessagesLink,
- $newMessagesDiffLink
- )->text();
+ if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) {
+ $ntl = $this->msg(
+ 'youhavenewmessagesfromusers',
+ $newMessagesLink,
+ $newMessagesDiffLink
+ )->numParams( $nofAuthors );
+ } else {
+ // $nofAuthors === 11 signifies "11 or more" ("more than 10")
+ $ntl = $this->msg(
+ $nofAuthors > 10 ? 'youhavenewmessagesmanyusers' : 'youhavenewmessages',
+ $newMessagesLink,
+ $newMessagesDiffLink
+ );
+ }
+ $ntl = $ntl->text();
# Disable Squid cache
$out->setSquidMaxage( 0 );
}
/**
* Returns true if the title is inside the specified namespace.
- *
+ *
* Please make use of this instead of comparing to getNamespace()
* This function is much more resistant to changes we may make
* to namespaces than code that makes direct comparisons.
$title_protection['pt_create_perm'] = 'protect'; // B/C
}
if( $title_protection['pt_create_perm'] == '' ||
- !$user->isAllowed( $title_protection['pt_create_perm'] ) )
+ !$user->isAllowed( $title_protection['pt_create_perm'] ) )
{
$errors[] = array( 'titleprotected', User::whoIs( $title_protection['pt_user'] ), $title_protection['pt_reason'] );
}
}
/**
- * Get the number of authors between the given revision IDs.
+ * Get the number of authors between the given revisions or revision IDs.
* Used for diffs and other things that really need it.
*
- * @param $old int|Revision Old revision or rev ID (first before range)
- * @param $new int|Revision New revision or rev ID (first after range)
- * @param $limit Int Maximum number of authors
- * @return Int Number of revision authors between these revisions.
- */
- public function countAuthorsBetween( $old, $new, $limit ) {
+ * @param $old int|Revision Old revision or rev ID (first before range by default)
+ * @param $new int|Revision New revision or rev ID (first after range by default)
+ * @param $limit int Maximum number of authors
+ * @param $options string|array (Optional): Single option, or an array of options:
+ * 'include_old' Include $old in the range; $new is excluded.
+ * 'include_new' Include $new in the range; $old is excluded.
+ * 'include_both' Include both $old and $new in the range.
+ * Unknown option values are ignored.
+ * @return int Number of revision authors in the range; zero if not both revisions exist
+ */
+ public function countAuthorsBetween( $old, $new, $limit, $options = array() ) {
if ( !( $old instanceof Revision ) ) {
$old = Revision::newFromTitle( $this, (int)$old );
}
if ( !( $new instanceof Revision ) ) {
$new = Revision::newFromTitle( $this, (int)$new );
}
+ // XXX: what if Revision objects are passed in, but they don't refer to this title?
+ // Add $old->getPage() != $new->getPage() || $old->getPage() != $this->getArticleID()
+ // in the sanity check below?
if ( !$old || !$new ) {
return 0; // nothing to compare
}
+ $old_cmp = '>';
+ $new_cmp = '<';
+ $options = (array) $options;
+ if ( in_array( 'include_old', $options ) ) {
+ $old_cmp = '>=';
+ }
+ if ( in_array( 'include_new', $options ) ) {\r
+ $new_cmp = '<=';\r
+ }\r
+ if ( in_array( 'include_both', $options ) ) {\r
+ $old_cmp = '>=';\r
+ $new_cmp = '<=';
+ }
+ // No DB query needed if $old and $new are the same or successive revisions:
+ if ( $old->getId() === $new->getId() ) {
+ return ( $old_cmp === '>' && $new_cmp === '<' ) ? 0 : 1;
+ } else if ( $old->getId() === $new->getParentId() ) {
+ if ( $old_cmp === '>' || $new_cmp === '<' ) {
+ return ( $old_cmp === '>' && $new_cmp === '<' ) ? 0 : 1;
+ }
+ return ( $old->getRawUserText() === $new->getRawUserText() ) ? 1 : 2;
+ }\r
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'revision', 'DISTINCT rev_user_text',
array(
'rev_page' => $this->getArticleID(),
- 'rev_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $old->getTimestamp() ) ),
- 'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
+ "rev_timestamp $old_cmp " . $dbr->addQuotes( $dbr->timestamp( $old->getTimestamp() ) ),
+ "rev_timestamp $new_cmp " . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
), __METHOD__,
array( 'LIMIT' => $limit + 1 ) // add one so caller knows it was truncated
);
// parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
if ( !$bits ||
!isset( $bits['scheme'] ) && strpos( $url, "://" ) !== false ) {
- wfWarn( __METHOD__ . ": Invalid URL: $url" );
+ wfDebug( __METHOD__ . ": Invalid URL: $url" );
return false;
} else {
$scheme = isset( $bits['scheme'] ) ? $bits['scheme'] : null;
if ( in_array( $scheme . '://', $wgUrlProtocols ) ) {
$bits['delimiter'] = '://';
} elseif ( !is_null( $scheme ) && !in_array( $scheme . ':', $wgUrlProtocols ) ) {
- wfWarn( __METHOD__ . ": Invalid scheme in URL: $scheme" );
+ wfDebug( __METHOD__ . ": Invalid scheme in URL: $scheme" );
return false;
} elseif( !is_null( $scheme ) ) {
if( !in_array( $scheme . ':', $wgUrlProtocols ) ) {
foreach ( $components as $name => $value ) {
if ( isset( self::$componentAliases[$name] ) ) {
$canonical = self::$componentAliases[$name];
- wfWarn( __METHOD__ . ": Converting alias $name to canonical $canonical." );
+ wfDebug( __METHOD__ . ": Converting alias $name to canonical $canonical." );
$components[$canonical] = $value;
unset( $components[$name] );
} elseif ( !in_array( $name, self::$validComponents ) ) {
- wfWarn( __METHOD__ . ": $name is not a valid component." );
- unset( $components[$name] );
+ throw new MWException( __METHOD__ . ": $name is not a valid component." );
}
}
// Component is an alias. Get the actual name.
$alias = $name;
$name = self::$componentAliases[$name];
- wfWarn( __METHOD__ . ": Converting alias $alias to canonical $name." );
+ wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
}
if( !in_array( $name, self::$validComponents ) ) {
if ( isset( self::$componentAliases[$name] ) ) {
$alias = $name;
$name = self::$componentAliases[$name];
- wfWarn( __METHOD__ . ": Converting alias $alias to canonical $name." );
+ wfDebug( __METHOD__ . ": Converting alias $alias to canonical $name." );
} elseif ( !in_array( $name, self::$validComponents ) ) {
throw new MWException( __METHOD__ . ": $name is not a valid component." );
}
* @return Uri this URI object
*/
public function extendQuery( $parameters ) {
- if ( is_string( $parameters ) ) {
+ if ( !is_array( $parameters ) ) {
$parameters = wfCgiToArray( $parameters );
}
*/
public function getNewMessageLinks() {
$talks = array();
- if( !wfRunHooks( 'UserRetrieveNewTalks', array( &$this, &$talks ) ) )
+ if( !wfRunHooks( 'UserRetrieveNewTalks', array( &$this, &$talks ) ) ) {
return $talks;
-
- if( !$this->getNewtalk() )
+ } elseif( !$this->getNewtalk() ) {
return array();
- $up = $this->getUserPage();
- $utp = $up->getTalkPage();
- return array( array( 'wiki' => wfWikiID(), 'link' => $utp->getLocalURL() ) );
+ }
+ $utp = $this->getTalkPage();
+ $dbr = wfGetDB( DB_SLAVE );
+ // Get the "last viewed rev" timestamp from the oldest message notification
+ $timestamp = $dbr->selectField( 'user_newtalk',
+ 'MIN(user_last_timestamp)',
+ $this->isAnon() ? array( 'user_ip' => $this->getName() ) : array( 'user_id' => $this->getID() ),
+ __METHOD__ );
+ $rev = $timestamp ? Revision::loadFromTimestamp( $dbr, $utp, $timestamp ) : null;
+ return array( array( 'wiki' => wfWikiID(), 'link' => $utp->getLocalURL(), 'rev' => $rev ) );
}
/**
* Add or update the new messages flag
* @param $field String 'user_ip' for anonymous users, 'user_id' otherwise
* @param $id String|Int User's IP address for anonymous users, User ID otherwise
+ * @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null.
* @return Bool True if successful, false otherwise
*/
- protected function updateNewtalk( $field, $id ) {
+ protected function updateNewtalk( $field, $id, $curRev = null ) {
+ // Get timestamp of the talk page revision prior to the current one
+ $prevRev = $curRev ? $curRev->getPrevious() : false;
+ $ts = $prevRev ? $prevRev->getTimestamp() : null;
+ // Mark the user as having new messages since this revision
$dbw = wfGetDB( DB_MASTER );
$dbw->insert( 'user_newtalk',
- array( $field => $id ),
+ array( $field => $id, 'user_last_timestamp' => $dbw->timestampOrNull( $ts ) ),
__METHOD__,
'IGNORE' );
if ( $dbw->affectedRows() ) {
/**
* Update the 'You have new messages!' status.
* @param $val Bool Whether the user has new messages
+ * @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null or !$val.
*/
- public function setNewtalk( $val ) {
+ public function setNewtalk( $val, $curRev = null ) {
if( wfReadOnly() ) {
return;
}
global $wgMemc;
if( $val ) {
- $changed = $this->updateNewtalk( $field, $id );
+ $changed = $this->updateNewtalk( $field, $id, $curRev );
} else {
$changed = $this->deleteNewtalk( $field, $id );
}
*
* @internal documentation reviewed 15 Mar 2010
*/
-class WikiPage extends Page {
+class WikiPage extends Page implements IDBAccessObject {
// Constants for $mDataLoadedFrom and related
- /**
- * Data has not been loaded yet (or the object was cleared)
- */
- const DATA_NOT_LOADED = 0;
-
- /**
- * Data has been loaded from a slave database
- */
- const DATA_FROM_SLAVE = 1;
-
- /**
- * Data has been loaded from the master database
- */
- const DATA_FROM_MASTER = 2;
-
- /**
- * Data has been loaded from the master database using FOR UPDATE
- */
- const DATA_FOR_UPDATE = 3;
-
/**
* @var Title
*/
/**@}}*/
/**
- * @var int; one of the DATA_* constants
+ * @var int; one of the READ_* constants
*/
- protected $mDataLoadedFrom = self::DATA_NOT_LOADED;
+ protected $mDataLoadedFrom = self::READ_NONE;
/**
* @var Title
*
* @param $id Int article ID to load
* @param $from string|int one of the following values:
- * - "fromdb" or self::DATA_FROM_SLAVE to select from a slave database
- * - "fromdbmaster" or self::DATA_FROM_MASTER to select from the master database
+ * - "fromdb" or WikiPage::READ_NORMAL to select from a slave database
+ * - "fromdbmaster" or WikiPage::READ_LATEST to select from the master database
*
* @return WikiPage|null
*/
public static function newFromID( $id, $from = 'fromdb' ) {
$from = self::convertSelectType( $from );
- $db = wfGetDB( $from === self::DATA_FROM_MASTER ? DB_MASTER : DB_SLAVE );
+ $db = wfGetDB( $from === self::READ_LATEST ? DB_MASTER : DB_SLAVE );
$row = $db->selectRow( 'page', self::selectFields(), array( 'page_id' => $id ), __METHOD__ );
if ( !$row ) {
return null;
* @param $row object: database row containing at least fields returned
* by selectFields().
* @param $from string|int: source of $data:
- * - "fromdb" or self::DATA_FROM_SLAVE: from a slave DB
- * - "fromdbmaster" or self::DATA_FROM_MASTER: from the master DB
- * - "forupdate" or self::DATA_FOR_UPDATE: from the master DB using SELECT FOR UPDATE
+ * - "fromdb" or WikiPage::READ_NORMAL: from a slave DB
+ * - "fromdbmaster" or WikiPage::READ_LATEST: from the master DB
+ * - "forupdate" or WikiPage::READ_LOCKING: from the master DB using SELECT FOR UPDATE
* @return WikiPage
*/
public static function newFromRow( $row, $from = 'fromdb' ) {
}
/**
- * Convert 'fromdb', 'fromdbmaster' and 'forupdate' to DATA_* constants.
+ * Convert 'fromdb', 'fromdbmaster' and 'forupdate' to READ_* constants.
*
* @param $type object|string|int
* @return mixed
private static function convertSelectType( $type ) {
switch ( $type ) {
case 'fromdb':
- return self::DATA_FROM_SLAVE;
+ return self::READ_NORMAL;
case 'fromdbmaster':
- return self::DATA_FROM_MASTER;
+ return self::READ_LATEST;
case 'forupdate':
- return self::DATA_FOR_UPDATE;
+ return self::READ_LOCKING;
default:
// It may already be an integer or whatever else
return $type;
*/
public function clear() {
$this->mDataLoaded = false;
- $this->mDataLoadedFrom = self::DATA_NOT_LOADED;
+ $this->mDataLoadedFrom = self::READ_NONE;
$this->clearCacheFields();
}
*
* @param $from object|string|int One of the following:
* - A DB query result object
- * - "fromdb" or self::DATA_FROM_SLAVE to get from a slave DB
- * - "fromdbmaster" or self::DATA_FROM_MASTER to get from the master DB
- * - "forupdate" or self::DATA_FOR_UPDATE to get from the master DB using SELECT FOR UPDATE
+ * - "fromdb" or WikiPage::READ_NORMAL to get from a slave DB
+ * - "fromdbmaster" or WikiPage::READ_LATEST to get from the master DB
+ * - "forupdate" or WikiPage::READ_LOCKING to get from the master DB using SELECT FOR UPDATE
*
* @return void
*/
return;
}
- if ( $from === self::DATA_FOR_UPDATE ) {
+ if ( $from === self::READ_LOCKING ) {
$data = $this->pageDataFromTitle( wfGetDB( DB_MASTER ), $this->mTitle, array( 'FOR UPDATE' ) );
- } elseif ( $from === self::DATA_FROM_MASTER ) {
+ } elseif ( $from === self::READ_LATEST ) {
$data = $this->pageDataFromTitle( wfGetDB( DB_MASTER ), $this->mTitle );
- } elseif ( $from === self::DATA_FROM_SLAVE ) {
+ } elseif ( $from === self::READ_NORMAL ) {
$data = $this->pageDataFromTitle( wfGetDB( DB_SLAVE ), $this->mTitle );
# Use a "last rev inserted" timestamp key to dimish the issue of slave lag.
# Note that DB also stores the master position in the session and checks it.
$touched = $this->getCachedLastEditTime();
if ( $touched ) { // key set
if ( !$data || $touched > wfTimestamp( TS_MW, $data->page_touched ) ) {
- $from = self::DATA_FROM_MASTER;
+ $from = self::READ_LATEST;
$data = $this->pageDataFromTitle( wfGetDB( DB_MASTER ), $this->mTitle );
}
}
} else {
// No idea from where the caller got this data, assume slave database.
$data = $from;
- $from = self::DATA_FROM_SLAVE;
+ $from = self::READ_NORMAL;
}
$this->loadFromRow( $data, $from );
* @param $data object: database row containing at least fields returned
* by selectFields()
* @param $from string|int One of the following:
- * - "fromdb" or self::DATA_FROM_SLAVE if the data comes from a slave DB
- * - "fromdbmaster" or self::DATA_FROM_MASTER if the data comes from the master DB
- * - "forupdate" or self::DATA_FOR_UPDATE if the data comes from from
+ * - "fromdb" or WikiPage::READ_NORMAL if the data comes from a slave DB
+ * - "fromdbmaster" or WikiPage::READ_LATEST if the data comes from the master DB
+ * - "forupdate" or WikiPage::READ_LOCKING if the data comes from from
* the master DB using SELECT FOR UPDATE
*/
public function loadFromRow( $data, $from ) {
// also gets the revision row FOR UPDATE; otherwise, it may not find it since a page row
// UPDATE and revision row INSERT by S2 may have happened after the first S1 SELECT.
// http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read.
- $flags = ( $this->mDataLoadedFrom == self::DATA_FOR_UPDATE ) ? Revision::LOCKING_READ : 0;
+ $flags = ( $this->mDataLoadedFrom == self::READ_LOCKING ) ? Revision::READ_LOCKING : 0;
$revision = Revision::newFromPageId( $this->getId(), $latest, $flags );
if ( $revision ) { // sanity
$this->setLastEdit( $revision );
wfDebug( __METHOD__ . ": invalid username\n" );
} elseif ( User::isIP( $shortTitle ) ) {
// An anonymous user
- $other->setNewtalk( true );
+ $other->setNewtalk( true, $revision );
} elseif ( $other->isLoggedIn() ) {
- $other->setNewtalk( true );
+ $other->setNewtalk( true, $revision );
} else {
wfDebug( __METHOD__ . ": don't need to notify a nonexistent user\n" );
}
if ( !$oldfile->exists() || !$oldfile->isLocal() || $oldfile->getRedirected() ) {
return array( array( 'nodeleteablefile' ) );
}
- } else {
- $oldfile = false;
}
if ( is_null( $reason ) ) { // Log and RC don't like null reasons
$args = array_merge( array( $params, 'entirewatchlist' ), array_keys( $pageSet->getAllowedParams() ) );
call_user_func_array( array( $this, 'requireOnlyOneParameter' ), $args );
- $db = $this->getDB();
$dbw = $this->getDB( DB_MASTER );
$timestamp = null;
}
// Now, put the valid titles into the result
- $pages = array();
foreach ( $pageSet->getTitles() as $title ) {
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
* @return array
*/
protected function getApiWarnings() {
- $warnings = array();
-
$warnings = $this->mUpload->checkWarnings();
return $this->transformWarnings( $warnings );
*/
/**
- * Interface for database access objects
+ * Interface for database access objects.
+ *
+ * Classes using this support a set of constants in a bitfield argument to their data loading
+ * functions. In general, objects should assume READ_NORMAL if no flags are explicitly given,
+ * though certain objects may assume READ_LATEST for common use case or legacy reasons.
+ *
+ * There are three types of reads:
+ * - READ_NORMAL : Potentially cached read of data (e.g. from a slave or stale replica)
+ * - READ_LATEST : Up-to-date read as of transaction start (e.g. from master or a quorum read)
+ * - READ_LOCKING : Up-to-date read as of now, that locks the records for the transaction
+ *
+ * Callers should use READ_NORMAL (or pass in no flags) unless the read determines a write.
+ * In theory, such cases may require READ_LOCKING, though to avoid contention, READ_LATEST is
+ * often good enough. If UPDATE race condition checks are required on a row and expensive code
+ * must run after the row is fetched to determine the UPDATE, it may help to do something like:
+ * - a) Read the current row
+ * - b) Determine the new row (expensive, so we don't want to hold locks now)
+ * - c) Re-read the current row with READ_LOCKING; if it changed then bail out
+ * - d) otherwise, do the updates
*/
interface IDBAccessObject {
- const LATEST_READ = 1; // read from the master
- const FOR_UPDATE = 2; // lock the rows read
- const LOCKING_READ = 3; // LATEST_READ | FOR_UPDATE
- const AVOID_MASTER = 4; // avoiding checking the master
+ // Constants for object loading bitfield flags (higher => higher QoS)
+ const READ_LATEST = 1; // read from the master
+ const READ_LOCKING = 3; // READ_LATEST and "FOR UPDATE"
+
+ // Convenience constant for callers to explicitly request slave data
+ const READ_NORMAL = 0; // read from the slave
+
+ // Convenience constant for tracking how data was loaded (higher => higher QoS)
+ const READ_NONE = -1; // not loaded yet (or the object was cleared)
}
return true;
}
- /**
- * Returns true if this database requires that SELECT DISTINCT queries require that all
- ORDER BY expressions occur in the SELECT list per the SQL92 standard
- *
- * @return bool
- */
- function standardSelectDistinct() {
- return true;
- }
-
/**
* Returns true if this database can do a native search on IP columns
* e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32';
throw new MWException( 'Database serialization may cause problems, since the connection is not restored on wakeup.' );
}
- /**
- * Same as new DatabaseMysql( ... ), kept for backward compatibility
- * @deprecated since 1.17
- *
- * @param $server
- * @param $user
- * @param $password
- * @param $dbName
- * @param $flags int
- * @return DatabaseMysql
- */
- static function newFromParams( $server, $user, $password, $dbName, $flags = 0 ) {
- wfDeprecated( __METHOD__, '1.17' );
- return new DatabaseMysql( $server, $user, $password, $dbName, $flags );
- }
-
- /**
- * Same as new factory( ... ), kept for backward compatibility
- * @deprecated since 1.18
- * @see Database::factory()
- * @return DatabaseBase
- */
- public final static function newFromType( $dbType, $p = array() ) {
- wfDeprecated( __METHOD__, '1.18' );
- if ( isset( $p['tableprefix'] ) ) {
- $p['tablePrefix'] = $p['tableprefix'];
- }
- return self::factory( $dbType, $p );
- }
-
/**
* Given a DB type, construct the name of the appropriate child class of
* DatabaseBase. This is designed to replace all of the manual stuff like:
* & = filename; reads the file and inserts as a blob
* (we don't use this though...)
*
- * This function should not be used directly by new code outside of the
- * database classes. The query wrapper functions (select() etc.) should be
- * used instead.
- *
* @param $sql string
* @param $func string
*
* @return array
*/
- function prepare( $sql, $func = 'DatabaseBase::prepare' ) {
+ protected function prepare( $sql, $func = 'DatabaseBase::prepare' ) {
/* MySQL doesn't support prepared statements (yet), so just
pack up the query for reference. We'll manually replace
the bits later. */
* Free a prepared query, generated by prepare().
* @param $prepared
*/
- function freePrepared( $prepared ) {
+ protected function freePrepared( $prepared ) {
/* No-op by default */
}
}
/**
- * Prepare & execute an SQL statement, quoting and inserting arguments
- * in the appropriate places.
+ * For faking prepared SQL statements on DBs that don't support it directly.
*
- * This function should not be used directly by new code outside of the
- * database classes. The query wrapper functions (select() etc.) should be
- * used instead.
- *
- * @param $query String
- * @param $args ...
- *
- * @return ResultWrapper
- */
- function safeQuery( $query, $args = null ) {
- $prepared = $this->prepare( $query, 'DatabaseBase::safeQuery' );
-
- if ( !is_array( $args ) ) {
- # Pull the var args
- $args = func_get_args();
- array_shift( $args );
- }
-
- $retval = $this->execute( $prepared, $args );
- $this->freePrepared( $prepared );
-
- return $retval;
- }
-
- /**
- * For faking prepared SQL statements on DBs that don't support
- * it directly.
* @param $preparedQuery String: a 'preparable' SQL statement
* @param $args Array of arguments to fill it with
* @return string executable SQL
* @param $matches Array
* @return String
*/
- function fillPreparedArg( $matches ) {
+ protected function fillPreparedArg( $matches ) {
switch( $matches[1] ) {
case '\\?': return '?';
case '\\!': return '!';
*
* @param $res Mixed: A SQL result
*/
- function freeResult( $res ) {
- }
-
- /**
- * Simple UPDATE wrapper.
- * Usually throws a DBQueryError on failure.
- * If errors are explicitly ignored, returns success
- *
- * This function exists for historical reasons, DatabaseBase::update() has a more standard
- * calling convention and feature set
- *
- * @param $table string
- * @param $var
- * @param $value
- * @param $cond
- * @param $fname string
- *
- * @return bool
- */
- function set( $table, $var, $value, $cond, $fname = 'DatabaseBase::set' ) {
- $table = $this->tableName( $table );
- $sql = "UPDATE $table SET $var = '" .
- $this->strencode( $value ) . "' WHERE ($cond)";
-
- return (bool)$this->query( $sql, $fname );
- }
+ public function freeResult( $res ) {}
/**
* A SELECT wrapper which returns a single field from a single result row.
/**
* The equivalent of DatabaseBase::select() except that the constructed SQL
- * is returned, instead of being immediately executed.
+ * is returned, instead of being immediately executed. This can be useful for
+ * doing UNION queries, where the SQL text of each query is needed. In general,
+ * however, callers outside of Database classes should just use select().
*
* @param $table string|array Table name
* @param $vars string|array Field names
$fname = 'DatabaseBase::estimateRowCount', $options = array() )
{
$rows = 0;
- $res = $this->select ( $table, 'COUNT(*) AS rowcount', $conds, $fname, $options );
+ $res = $this->select( $table, 'COUNT(*) AS rowcount', $conds, $fname, $options );
if ( $res ) {
$row = $this->fetchRow( $res );
* @param $options array
* @return string
*/
- function makeInsertOptions( $options ) {
+ protected function makeInsertOptions( $options ) {
return implode( ' ', $options );
}
* @param $options Array: The options passed to DatabaseBase::update
* @return string
*/
- function makeUpdateOptions( $options ) {
+ protected function makeUpdateOptions( $options ) {
if ( !is_array( $options ) ) {
$options = array( $options );
}
}
/**
- * Bitwise operations
+ * Return aggregated value alias
+ *
+ * @param $valuedata
+ * @param $valuename string
+ *
+ * @return string
*/
+ public function aggregateValue( $valuedata, $valuename = 'value' ) {
+ return $valuename;
+ }
/**
* @param $field
return "($fieldLeft | $fieldRight)";
}
+ /**
+ * Build a concatenation list to feed into a SQL query
+ * @param $stringList Array: list of raw SQL expressions; caller is responsible for any quoting
+ * @return String
+ */
+ public function buildConcat( $stringList ) {
+ return 'CONCAT(' . implode( ',', $stringList ) . ')';
+ }
+
/**
* Change the current database
*
*
* @return string
*/
- function indexName( $index ) {
+ protected function indexName( $index ) {
// Backwards-compatibility hack
$renamed = array(
'ar_usertext_timestamp' => 'usertext_timestamp',
return $name[0] == '"' && substr( $name, -1, 1 ) == '"';
}
- /**
- * Backwards compatibility, identifier quoting originated in DatabasePostgres
- * which used quote_ident which does not follow our naming conventions
- * was renamed to addIdentifierQuotes.
- * @deprecated since 1.18 use addIdentifierQuotes
- *
- * @param $s string
- *
- * @return string
- */
- function quote_ident( $s ) {
- wfDeprecated( __METHOD__, '1.18' );
- return $this->addIdentifierQuotes( $s );
- }
-
- /**
- * Escape string for safe LIKE usage.
- * WARNING: you should almost never use this function directly,
- * instead use buildLike() that escapes everything automatically
- * @deprecated since 1.17, warnings in 1.17, removed in ???
- *
- * @param $s string
- *
- * @return string
- */
- public function escapeLike( $s ) {
- wfDeprecated( __METHOD__, '1.17' );
- return $this->escapeLikeInternal( $s );
- }
-
/**
* @param $s string
* @return string
* If the result of the query is not ordered, then the rows to be returned
* are theoretically arbitrary.
*
- * $sql is expected to be a SELECT, if that makes a difference. For
- * UPDATE, limitResultForUpdate should be used.
+ * $sql is expected to be a SELECT, if that makes a difference.
*
* The version provided by default works in MySQL and SQLite. It will very
* likely need to be overridden for most other DBMSes.
if ( !is_numeric( $limit ) ) {
throw new DBUnexpectedError( $this, "Invalid non-numeric limit passed to limitResult()\n" );
}
-
return "$sql LIMIT "
- . ( ( is_numeric( $offset ) && $offset != 0 ) ? "{$offset}," : "" )
- . "{$limit} ";
- }
-
- /**
- * @param $sql
- * @param $num
- * @return string
- */
- function limitResultForUpdate( $sql, $num ) {
- return $this->limitResult( $sql, $num, 0 );
+ . ( ( is_numeric( $offset ) && $offset != 0 ) ? "{$offset}," : "" )
+ . "{$limit} ";
}
/**
}
}
- /**
- * Return aggregated value alias
- *
- * @param $valuedata
- * @param $valuename string
- *
- * @return string
- */
- function aggregateValue ( $valuedata, $valuename = 'value' ) {
- return $valuename;
- }
-
/**
* Ping the server and try to reconnect if it there is no connection
*
return $b;
}
- /**
- * Override database's default connection timeout
- *
- * @param $timeout Integer in seconds
- * @return void
- * @deprecated since 1.19; use setSessionOptions()
- */
- public function setTimeout( $timeout ) {
- wfDeprecated( __METHOD__, '1.19' );
- $this->setSessionOptions( array( 'connTimeout' => $timeout ) );
- }
-
/**
* Override database's default behavior. $options include:
* 'connTimeout' : Set the connection timeout value in seconds.
return $this->indexName( $matches[1] );
}
- /**
- * Build a concatenation list to feed into a SQL query
- * @param $stringList Array: list of raw SQL expressions; caller is responsible for any quoting
- * @return String
- */
- function buildConcat( $stringList ) {
- return 'CONCAT(' . implode( ',', $stringList ) . ')';
- }
-
/**
* Check to see if a named lock is available. This is non-blocking.
*
*/
public function __construct( $db, $result, $num_rows, $sql, $columns ){
$this->db = $db;
-
+
if( $result instanceof ResultWrapper ){
$this->result = $result->result;
}
else{
$this->result = $result;
}
-
+
$this->num_rows = $num_rows;
$this->current_pos = 0;
if ( $this->num_rows > 0 ) {
// Make a lower-case list of the column names
// By default, DB2 column names are capitalized
// while MySQL column names are lowercase
-
+
// Is there a reasonable maximum value for $i?
// Setting to 2048 to prevent an infinite loop
for( $i = 0; $i < 2048; $i++ ) {
else {
return false;
}
-
+
$this->columns[$i] = strtolower( $name );
}
}
-
+
$this->sql = $sql;
}
* @return mixed Object on success, false on failure.
*/
public function fetchObject() {
- if ( $this->result
- && $this->num_rows > 0
- && $this->current_pos >= 0
- && $this->current_pos < $this->num_rows )
+ if ( $this->result
+ && $this->num_rows > 0
+ && $this->current_pos >= 0
+ && $this->current_pos < $this->num_rows )
{
$row = $this->fetchRow();
$ret = new stdClass();
-
+
foreach ( $row as $k => $v ) {
$lc = $this->columns[$k];
$ret->$lc = $v;
* @throws DBUnexpectedError
*/
public function fetchRow(){
- if ( $this->result
- && $this->num_rows > 0
- && $this->current_pos >= 0
+ if ( $this->result
+ && $this->num_rows > 0
+ && $this->current_pos >= 0
&& $this->current_pos < $this->num_rows )
{
if ( $this->loadedLines <= $this->current_pos ) {
if ( $this->loadedLines > $this->current_pos ){
return $this->resultSet[$this->current_pos++];
}
-
+
}
return false;
}
return 'ibm_db2';
}
- /**
+ /**
* Returns the database connection object
* @return Object
*/
$res2 = parent::select( $table, $vars2, $conds, $fname, $options2,
$join_conds );
-
+
$obj = $this->fetchObject( $res2 );
$this->mNumRows = $obj->num_rows;
-
+
return new ResultWrapper( $this, new IBM_DB2Result( $this, $res, $obj->num_rows, $vars, $sql ) );
}
######################################
# Unimplemented and not applicable
######################################
- /**
- * Not implemented
- * @return string $sql
- */
- public function limitResultForUpdate( $sql, $num ) {
- $this->installPrint( 'Not implemented for DB2: limitResultForUpdate()' );
- return $sql;
- }
/**
* Only useful with fake prepare like in base Database class
return $res;
}
- /**
- * Prepare & execute an SQL statement, quoting and inserting arguments
- * in the appropriate places.
- * @param $query String
- * @param $args ...
- * @return Resource
- */
- public function safeQuery( $query, $args = null ) {
- // copied verbatim from Database.php
- $prepared = $this->prepare( $query, 'DB2::safeQuery' );
- if( !is_array( $args ) ) {
- # Pull the var args
- $args = func_get_args();
- array_shift( $args );
- }
- $retval = $this->execute( $prepared, $args );
- $this->freePrepared( $prepared );
- return $retval;
- }
-
/**
* For faking prepared SQL statements on DBs that don't support
* it directly.
return $sql;
}
- // MSSQL does support this, but documentation is too thin to make a generalized
- // function for this. Apparently UPDATE TOP (N) works, but the sort order
- // may not be what we're expecting so the top n results may be a random selection.
- // TODO: Implement properly.
- function limitResultForUpdate( $sql, $num ) {
- return $sql;
- }
-
function timestamp( $ts = 0 ) {
return wfTimestamp( TS_ISO_8601, $ts );
}
return '[http://www.mysql.com/ MySQL]';
}
- /**
- * @return bool
- */
- function standardSelectDistinct() {
- return false;
- }
-
/**
* @param $options array
*/
}
}
- /* Not even sure why this is used in the main codebase... */
- function limitResultForUpdate( $sql, $num ) {
- return $sql;
- }
-
/* defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}'; */
function sourceStream( $fp, $lineCallback = false, $resultCallback = false,
$fname = 'DatabaseOracle::sourceStream', $inputCallback = false ) {
return pg_field_type( $res, $index );
}
- /* Not even sure why this is used in the main codebase... */
- function limitResultForUpdate( $sql, $num ) {
- return $sql;
- }
-
/**
* @param $b
* @return Blob
}
$cachedResult = false;
$table = 'dummy_search_test';
-
+
$db = new DatabaseSqliteStandalone( ':memory:' );
if ( $db->query( "CREATE VIRTUAL TABLE $table USING FTS3(dummy_field)", __METHOD__, true ) ) {
/**
* @param $res ResultWrapper
- * @param $n
+ * @param $n
* @return bool
*/
function fieldName( $res, $n ) {
$this->mTrxLevel = 0;
}
- /**
- * @param $sql
- * @param $num
- * @return string
- */
- function limitResultForUpdate( $sql, $num ) {
- return $this->limitResult( $sql, $num );
- }
-
/**
* @param $s string
* @return string
}
return $this->query( $sql, $fname );
}
-
-
+
+
/**
* List all tables on the database
*
'name',
"type='table'"
);
-
+
$endArray = array();
-
- foreach( $result as $table ) {
+
+ foreach( $result as $table ) {
$vars = get_object_vars($table);
$table = array_pop( $vars );
-
+
if( !$prefix || strpos( $table, $prefix ) === 0 ) {
if ( strpos( $table, 'sqlite_' ) !== 0 ) {
$endArray[] = $table;
}
-
+
}
}
-
+
return $endArray;
}
// Load the new revision object
$this->mNewRev = $this->mNewid
? Revision::newFromId( $this->mNewid )
- : Revision::newFromTitle( $this->getTitle(), false, Revision::AVOID_MASTER );
+ : Revision::newFromTitle( $this->getTitle(), false, Revision::READ_NORMAL );
if ( !$this->mNewRev instanceof Revision ) {
return false;
* @ingroup LockManager
* @since 1.19
*/
-class DBLockManager extends LockManager {
+class DBLockManager extends QuorumLockManager {
/** @var Array Map of DB names to server config */
protected $dbServers; // (DB name => server config array)
- /** @var Array Map of bucket indexes to peer DB lists */
- protected $dbsByBucket; // (bucket index => (ldb1, ldb2, ...))
/** @var BagOStuff */
protected $statusCache;
/**
* Construct a new instance from configuration.
- *
+ *
* $config paramaters include:
* 'dbServers' : Associative array of DB names to server configuration.
* Configuration is an associative array that includes:
* This tells the DB server how long to wait before assuming
* connection failure and releasing all the locks for a session.
*
- * @param Array $config
+ * @param Array $config
*/
public function __construct( array $config ) {
parent::__construct( $config );
$this->dbServers = isset( $config['dbServers'] )
? $config['dbServers']
: array(); // likely just using 'localDBMaster'
- // Sanitize dbsByBucket config to prevent PHP errors
- $this->dbsByBucket = array_filter( $config['dbsByBucket'], 'is_array' );
- $this->dbsByBucket = array_values( $this->dbsByBucket ); // consecutive
+ // Sanitize srvsByBucket config to prevent PHP errors
+ $this->srvsByBucket = array_filter( $config['dbsByBucket'], 'is_array' );
+ $this->srvsByBucket = array_values( $this->srvsByBucket ); // consecutive
if ( isset( $config['lockExpiry'] ) ) {
$this->lockExpiry = $config['lockExpiry'];
? 60 // pick a safe-ish number to match DB timeout default
: $this->lockExpiry; // cover worst case
- foreach ( $this->dbsByBucket as $bucket ) {
- if ( count( $bucket ) > 1 ) {
+ foreach ( $this->srvsByBucket as $bucket ) {
+ if ( count( $bucket ) > 1 ) { // multiple peers
// Tracks peers that couldn't be queried recently to avoid lengthy
// connection timeouts. This is useless if each bucket has one peer.
- $this->statusCache = wfGetMainCache();
+ try {
+ $this->statusCache = ObjectCache::newAccelerator( array() );
+ } catch ( MWException $e ) {
+ trigger_error( __CLASS__ .
+ " using multiple DB peers without apc, xcache, or wincache." );
+ }
break;
}
}
- $this->session = '';
- for ( $i = 0; $i < 5; $i++ ) {
- $this->session .= mt_rand( 0, 2147483647 );
- }
- $this->session = wfBaseConvert( sha1( $this->session ), 16, 36, 31 );
+ $this->session = wfRandomString( 31 );
}
/**
- * @see LockManager::doLock()
- * @param $paths array
- * @param $type int
+ * Get a connection to a lock DB and acquire locks on $paths.
+ * This does not use GET_LOCK() per http://bugs.mysql.com/bug.php?id=1118.
+ *
+ * @see QuorumLockManager::getLocksOnServer()
* @return Status
*/
- protected function doLock( array $paths, $type ) {
+ protected function getLocksOnServer( $lockSrv, array $paths, $type ) {
$status = Status::newGood();
- $pathsToLock = array();
- // Get locks that need to be acquired (buckets => locks)...
- foreach ( $paths as $path ) {
- if ( isset( $this->locksHeld[$path][$type] ) ) {
- ++$this->locksHeld[$path][$type];
- } elseif ( isset( $this->locksHeld[$path][self::LOCK_EX] ) ) {
- $this->locksHeld[$path][$type] = 1;
- } else {
- $bucket = $this->getBucketFromKey( $path );
- $pathsToLock[$bucket][] = $path;
- }
- }
-
- $lockedPaths = array(); // files locked in this attempt
- // Attempt to acquire these locks...
- foreach ( $pathsToLock as $bucket => $paths ) {
- // Try to acquire the locks for this bucket
- $res = $this->doLockingQueryAll( $bucket, $paths, $type );
- if ( $res === 'cantacquire' ) {
- // Resources already locked by another process.
- // Abort and unlock everything we just locked.
+ if ( $type == self::LOCK_EX ) { // writer locks
+ try {
+ $keys = array_unique( array_map( 'LockManager::sha1Base36', $paths ) );
+ # Build up values for INSERT clause
+ $data = array();
+ foreach ( $keys as $key ) {
+ $data[] = array( 'fle_key' => $key );
+ }
+ # Wait on any existing writers and block new ones if we get in
+ $db = $this->getConnection( $lockSrv ); // checked in isServerUp()
+ $db->insert( 'filelocks_exclusive', $data, __METHOD__ );
+ } catch ( DBError $e ) {
foreach ( $paths as $path ) {
$status->fatal( 'lockmanager-fail-acquirelock', $path );
}
- $status->merge( $this->doUnlock( $lockedPaths, $type ) );
- return $status;
- } elseif ( $res !== true ) {
- // Couldn't contact any DBs for this bucket.
- // Abort and unlock everything we just locked.
- $status->fatal( 'lockmanager-fail-db-bucket', $bucket );
- $status->merge( $this->doUnlock( $lockedPaths, $type ) );
- return $status;
}
- // Record these locks as active
- foreach ( $paths as $path ) {
- $this->locksHeld[$path][$type] = 1; // locked
- }
- // Keep track of what locks were made in this attempt
- $lockedPaths = array_merge( $lockedPaths, $paths );
}
return $status;
}
/**
- * @see LockManager::doUnlock()
- * @param $paths array
- * @param $type int
+ * @see QuorumLockManager::freeLocksOnServer()
* @return Status
*/
- protected function doUnlock( array $paths, $type ) {
+ protected function freeLocksOnServer( $lockSrv, array $paths, $type ) {
+ return Status::newGood(); // not supported
+ }
+
+ /**
+ * @see QuorumLockManager::releaseAllLocks()
+ * @return Status
+ */
+ protected function releaseAllLocks() {
$status = Status::newGood();
- foreach ( $paths as $path ) {
- if ( !isset( $this->locksHeld[$path] ) ) {
- $status->warning( 'lockmanager-notlocked', $path );
- } elseif ( !isset( $this->locksHeld[$path][$type] ) ) {
- $status->warning( 'lockmanager-notlocked', $path );
- } else {
- --$this->locksHeld[$path][$type];
- if ( $this->locksHeld[$path][$type] <= 0 ) {
- unset( $this->locksHeld[$path][$type] );
- }
- if ( !count( $this->locksHeld[$path] ) ) {
- unset( $this->locksHeld[$path] ); // no SH or EX locks left for key
+ foreach ( $this->conns as $lockDb => $db ) {
+ if ( $db->trxLevel() ) { // in transaction
+ try {
+ $db->rollback( __METHOD__ ); // finish transaction and kill any rows
+ } catch ( DBError $e ) {
+ $status->fatal( 'lockmanager-fail-db-release', $lockDb );
}
}
}
- // Reference count the locks held and COMMIT when zero
- if ( !count( $this->locksHeld ) ) {
- $status->merge( $this->finishLockTransactions() );
- }
-
return $status;
}
/**
- * Get a connection to a lock DB and acquire locks on $paths.
- * This does not use GET_LOCK() per http://bugs.mysql.com/bug.php?id=1118.
- *
- * @param $lockDb string
- * @param $paths Array
- * @param $type integer LockManager::LOCK_EX or LockManager::LOCK_SH
- * @return bool Resources able to be locked
- * @throws DBError
+ * @see QuorumLockManager::isServerUp()
+ * @return bool
*/
- protected function doLockingQuery( $lockDb, array $paths, $type ) {
- if ( $type == self::LOCK_EX ) { // writer locks
- $db = $this->getConnection( $lockDb );
- if ( !$db ) {
- return false; // bad config
- }
- $keys = array_unique( array_map( 'LockManager::sha1Base36', $paths ) );
- # Build up values for INSERT clause
- $data = array();
- foreach ( $keys as $key ) {
- $data[] = array( 'fle_key' => $key );
- }
- # Wait on any existing writers and block new ones if we get in
- $db->insert( 'filelocks_exclusive', $data, __METHOD__ );
+ protected function isServerUp( $lockSrv ) {
+ if ( !$this->cacheCheckFailures( $lockSrv ) ) {
+ return false; // recent failure to connect
}
- return true;
- }
-
- /**
- * Attempt to acquire locks with the peers for a bucket.
- * This should avoid throwing any exceptions.
- *
- * @param $bucket integer
- * @param $paths Array List of resource keys to lock
- * @param $type integer LockManager::LOCK_EX or LockManager::LOCK_SH
- * @return bool|string One of (true, 'cantacquire', 'dberrors')
- */
- protected function doLockingQueryAll( $bucket, array $paths, $type ) {
- $yesVotes = 0; // locks made on trustable DBs
- $votesLeft = count( $this->dbsByBucket[$bucket] ); // remaining DBs
- $quorum = floor( $votesLeft/2 + 1 ); // simple majority
- // Get votes for each DB, in order, until we have enough...
- foreach ( $this->dbsByBucket[$bucket] as $lockDb ) {
- // Check that DB is not *known* to be down
- if ( $this->cacheCheckFailures( $lockDb ) ) {
- try {
- // Attempt to acquire the lock on this DB
- if ( !$this->doLockingQuery( $lockDb, $paths, $type ) ) {
- return 'cantacquire'; // vetoed; resource locked
- }
- ++$yesVotes; // success for this peer
- if ( $yesVotes >= $quorum ) {
- return true; // lock obtained
- }
- } catch ( DBConnectionError $e ) {
- $this->cacheRecordFailure( $lockDb );
- } catch ( DBError $e ) {
- if ( $this->lastErrorIndicatesLocked( $lockDb ) ) {
- return 'cantacquire'; // vetoed; resource locked
- }
- }
- }
- --$votesLeft;
- $votesNeeded = $quorum - $yesVotes;
- if ( $votesNeeded > $votesLeft ) {
- // In "trust cache" mode we don't have to meet the quorum
- break; // short-circuit
- }
+ try {
+ $this->getConnection( $lockSrv );
+ } catch ( DBError $e ) {
+ $this->cacheRecordFailure( $lockSrv );
+ return false; // failed to connect
}
- // At this point, we must not have meet the quorum
- return 'dberrors'; // not enough votes to ensure correctness
+ return true;
}
/**
*/
protected function initConnection( $lockDb, DatabaseBase $db ) {}
- /**
- * Commit all changes to lock-active databases.
- * This should avoid throwing any exceptions.
- *
- * @return Status
- */
- protected function finishLockTransactions() {
- $status = Status::newGood();
- foreach ( $this->conns as $lockDb => $db ) {
- if ( $db->trxLevel() ) { // in transaction
- try {
- $db->rollback( __METHOD__ ); // finish transaction and kill any rows
- } catch ( DBError $e ) {
- $status->fatal( 'lockmanager-fail-db-release', $lockDb );
- }
- }
- }
- return $status;
- }
-
- /**
- * Check if the last DB error for $lockDb indicates
- * that a requested resource was locked by another process.
- * This should avoid throwing any exceptions.
- *
- * @param $lockDb string
- * @return bool
- */
- protected function lastErrorIndicatesLocked( $lockDb ) {
- if ( isset( $this->conns[$lockDb] ) ) { // sanity
- $db = $this->conns[$lockDb];
- return ( $db->wasDeadlock() || $db->wasLockTimeout() );
- }
- return false;
- }
-
/**
* Checks if the DB has not recently had connection/query errors.
* This just avoids wasting time on doomed connection attempts.
- *
+ *
* @param $lockDb string
* @return bool
*/
protected function cacheCheckFailures( $lockDb ) {
- if ( $this->statusCache && $this->safeDelay > 0 ) {
- $path = $this->getMissKey( $lockDb );
- $misses = $this->statusCache->get( $path );
- return !$misses;
- }
- return true;
+ return ( $this->statusCache && $this->safeDelay > 0 )
+ ? !$this->statusCache->get( $this->getMissKey( $lockDb ) )
+ : true;
}
/**
* @return bool Success
*/
protected function cacheRecordFailure( $lockDb ) {
- if ( $this->statusCache && $this->safeDelay > 0 ) {
- $path = $this->getMissKey( $lockDb );
- $misses = $this->statusCache->get( $path );
- if ( $misses ) {
- return $this->statusCache->incr( $path );
- } else {
- return $this->statusCache->add( $path, 1, $this->safeDelay );
- }
- }
- return true;
+ return ( $this->statusCache && $this->safeDelay > 0 )
+ ? $this->statusCache->set( $this->getMissKey( $lockDb ), 1, $this->safeDelay )
+ : true;
}
/**
* @return string
*/
protected function getMissKey( $lockDb ) {
- return 'lockmanager:querymisses:' . str_replace( ' ', '_', $lockDb );
- }
-
- /**
- * Get the bucket for resource path.
- * This should avoid throwing any exceptions.
- *
- * @param $path string
- * @return integer
- */
- protected function getBucketFromKey( $path ) {
- $prefix = substr( sha1( $path ), 0, 2 ); // first 2 hex chars (8 bits)
- return intval( base_convert( $prefix, 16, 10 ) ) % count( $this->dbsByBucket );
+ $lockDb = ( $lockDb === 'localDBMaster' ) ? wfWikiID() : $lockDb; // non-relative
+ return 'dblockmanager:downservers:' . str_replace( ' ', '_', $lockDb );
}
/**
* Make sure remaining locks get cleared for sanity
*/
function __destruct() {
- foreach ( $this->conns as $lockDb => $db ) {
+ foreach ( $this->conns as $db ) {
if ( $db->trxLevel() ) { // in transaction
try {
$db->rollback( __METHOD__ ); // finish transaction and kill any rows
}
/**
- * @param $lockDb string
- * @param $paths array
- * @param $type int
- * @return bool
+ * Get a connection to a lock DB and acquire locks on $paths.
+ * This does not use GET_LOCK() per http://bugs.mysql.com/bug.php?id=1118.
+ *
+ * @see DBLockManager::getLocksOnServer()
+ * @return Status
*/
- protected function doLockingQuery( $lockDb, array $paths, $type ) {
- $db = $this->getConnection( $lockDb );
- if ( !$db ) {
- return false;
- }
+ protected function getLocksOnServer( $lockSrv, array $paths, $type ) {
+ $status = Status::newGood();
+
+ $db = $this->getConnection( $lockSrv ); // checked in isServerUp()
$keys = array_unique( array_map( 'LockManager::sha1Base36', $paths ) );
# Build up values for INSERT clause
$data = array();
);
}
}
- return !$blocked;
+
+ if ( $blocked ) {
+ foreach ( $paths as $path ) {
+ $status->fatal( 'lockmanager-fail-acquirelock', $path );
+ }
+ }
+
+ return $status;
}
}
*/
function getDescriptionText() {
global $wgParser;
- $revision = Revision::newFromTitle( $this->title, false, Revision::AVOID_MASTER );
+ $revision = Revision::newFromTitle( $this->title, false, Revision::READ_NORMAL );
if ( !$revision ) return false;
$text = $revision->getText();
if ( !$text ) return false;
wfGetLB()->waitFor( $this->params['masterPos'] );
}
- $revision = Revision::newFromTitle( $this->title, 0, Revision::AVOID_MASTER );
+ $revision = Revision::newFromTitle( $this->title, 0, Revision::READ_NORMAL );
if ( !$revision ) {
$this->error = 'refreshLinks: Article not found "' .
$this->title->getPrefixedDBkey() . '"';
}
# Re-parse each page that transcludes this page and update their tracking links...
foreach ( $titles as $title ) {
- $revision = Revision::newFromTitle( $title, 0, Revision::AVOID_MASTER );
+ $revision = Revision::newFromTitle( $title, 0, Revision::READ_NORMAL );
if ( !$revision ) {
$this->error = 'refreshLinks: Article not found "' .
$title->getPrefixedDBkey() . '"';
public function getIRCActionText() {
$this->plaintext = true;
$this->irctext = true;
- $text = $this->getActionText();
$entry = $this->entry;
$parameters = $entry->getParameters();
* @return Boolean: success
*/
static function write( $id, $data ) {
- self::getCache()->set( self::getKey( $id ), $data, 3600 );
+ global $wgObjectCacheSessionExpiry;
+ self::getCache()->set( self::getKey( $id ), $data, $wgObjectCacheSessionExpiry );
return true;
}
// or {{filepath|300px}}, {{filepath|200x300px}}, {{filepath|nowiki|200x300px}}, {{filepath|200x300px|nowiki}}
public static function filepath( $parser, $name='', $argA='', $argB='' ) {
$file = wfFindFile( $name );
- $isNowiki = false;
if( $argA == 'nowiki' ) {
// {{filepath: | option [| size] }}
/**
* Get the target language for the content being parsed. This is usually the
* language that the content is in.
+ *
+ * @since 1.19
+ *
+ * @return Language|null
*/
- function getTargetLanguage() {
+ public function getTargetLanguage() {
$target = $this->mOptions->getTargetLanguage();
+
if ( $target !== null ) {
return $target;
} elseif( $this->mOptions->getInterfaceMessage() ) {
return $this->mOptions->getUserLangObj();
} elseif( is_null( $this->mTitle ) ) {
- throw new MWException( __METHOD__.': $this->mTitle is null' );
+ throw new MWException( __METHOD__ . ': $this->mTitle is null' );
}
+
return $this->mTitle->getPageLanguage();
}
# Get the revision
$rev = $id
? Revision::newFromId( $id )
- : Revision::newFromTitle( $title, 0, Revision::AVOID_MASTER );
+ : Revision::newFromTitle( $title, 0, Revision::READ_NORMAL );
$rev_id = $rev ? $rev->getId() : 0;
# If there is no current revision, there is no page
if ( $id === false && !$rev ) {
$this->mTitle = $title;
if ( !is_null( $this->mTitle ) ) {
$this->mRevision = Revision::newFromTitle(
- $this->mTitle, false, Revision::AVOID_MASTER );
+ $this->mTitle, false, Revision::READ_NORMAL );
if ( $this->mTitle->getNamespace() === NS_FILE )
$this->mImage = wfFindFile( $this->mTitle );
}
$page = $this->msg( 'booksources' )->inContentLanguage()->text();
$title = Title::makeTitleSafe( NS_PROJECT, $page ); # Show list in content language
if( is_object( $title ) && $title->exists() ) {
- $rev = Revision::newFromTitle( $title, false, Revision::AVOID_MASTER );
+ $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
$this->getOutput()->addWikiText( str_replace( 'MAGICNUMBER', $this->isbn, $rev->getText() ) );
return true;
}
* @since 1.20
*/
public function saveCache() {
- $this->cacheHelper->saveCache();
+ if ( isset( $this->cacheHelper ) ) {
+ $this->cacheHelper->saveCache();
+ }
}
/**
if ( count( $fields ) > 1 && $count > 30 ) {
$this->toc = Linker::tocIndent();
$tocLength = 0;
- foreach( $fields as $key => $data ) {
+ foreach( $fields as $data ) {
# strip out the 'ns' prefix from the section name:
$ns = substr( $data['section'], 2 );
return Html::openElement( 'form',
array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
- $this->getHiddenFields( array( 'limit', 'ilsearch', 'user' ) ) .
+ $this->getHiddenFields( array( 'limit', 'ilsearch', 'user', 'title' ) ) .
Html::closeElement( 'fieldset' ) .
Html::closeElement( 'form' ) . "\n";
}
}
return $queries;
}
+
+ function getTitle() {
+ return SpecialPage::getTitleFor( 'Listfiles' );
+ }
}
$query = array( 'wpCookieCheck' => $type );
if ( $this->mReturnTo ) {
$query['returnto'] = $this->mReturnTo;
+ $query['returntoquery'] = $this->mReturnToQuery;
}
$check = $titleObj->getFullURL( $query );
const WINDOWS_NONASCII_FILENAME = 13;
const FILENAME_TOO_LONG = 14;
+ /**
+ * @param $error int
+ * @return string
+ */
public function getVerificationErrorCode( $error ) {
$code_to_status = array(self::EMPTY_FILE => 'empty-file',
self::FILE_TOO_LARGE => 'file-too-large',
/**
* Check whether a request if valid for this handler
+ * @param $request
* @return bool
*/
public static function isValidRequest( $request ) {
* @param $tempPath string the temporary path
* @param $fileSize int the file size
* @param $removeTempFile bool (false) remove the temporary file?
- * @return null
+ * @throws MWException
*/
public function initializePathInfo( $name, $tempPath, $fileSize, $removeTempFile = false ) {
$this->mDesiredDestName = $name;
/**
* @param $srcPath String: the source path
- * @return stringthe real path if it was a virtual URL
+ * @return string the real path if it was a virtual URL
*/
function getRealPath( $srcPath ) {
wfProfileIn( __METHOD__ );
/**
* Return the local file and initializes if necessary.
*
- * @return LocalFile
+ * @return LocalFile|null
*/
public function getLocalFile() {
if( is_null( $this->mLocalFile ) ) {
* earlier pseudo-'extensions' to determine type and execute
* scripts, so the blacklist needs to check them all.
*
+ * @param $filename string
* @return array
*/
public static function splitExtensions( $filename ) {
return false;
}
+ /**
+ * @param $filename string
+ * @return bool
+ */
protected function detectScriptInSvg( $filename ) {
$check = new XmlTypeCheck( $filename, array( $this, 'checkSvgScriptCallback' ) );
return $check->filterMatch;
/**
* @todo Replace this with a whitelist filter!
+ * @param $element string
+ * @param $attribs array
* @return bool
*/
public function checkSvgScriptCallback( $element, $attribs ) {
return false; //No scripts detected
}
+ /**
+ * @param $name string
+ * @return string
+ */
private function stripXmlNamespace( $name ) {
// 'http://www.w3.org/2000/svg:script' -> 'script'
$parts = explode( ':', strtolower( $name ) );
/**
* Helper function that checks whether the filename looks like a thumbnail
+ * @param $filename string
* @return bool
*/
public static function isThumbName( $filename ) {
return $info;
}
-
+ /**
+ * @param $error array
+ * @return Status
+ */
public function convertVerifyErrorToStatus( $error ) {
$code = $error['status'];
unset( $code['status'] );
return Status::newFatal( $this->getVerificationErrorCode( $code ), $error );
}
+ /**
+ * @param $forType null|string
+ * @return int
+ */
public static function getMaxUploadSize( $forType = null ) {
global $wgMaxUploadSize;
*/
class UploadFromChunks extends UploadFromFile {
protected $mOffset, $mChunkIndex, $mFileKey, $mVirtualTempPath;
-
+
/**
* Setup local pointers to stash, repo and user ( similar to UploadFromStash )
- *
+ *
* @param $user User
* @param $stash UploadStash
* @param $repo FileRepo
// Output a copy of this first to chunk 0 location:
$status = $this->outputChunk( $this->mLocalFile->getPath() );
-
+
// Update db table to reflect initial "chunk" state
$this->updateChunkStatus();
return $this->mLocalFile;
}
-
+
/**
* Continue chunk uploading
*/
$this->mUpload = $webRequestUpload;
// Get the chunk status form the db:
$this->getChunkStatus();
-
+
$metadata = $this->stash->getMetadata( $key );
$this->initializePathInfo( $name,
$this->getRealPath( $metadata['us_path'] ),
false
);
}
-
+
/**
* Append the final chunk and ready file for parent::performUpload()
* @return FileRepoStatus
}
return $status;
}
-
+
/**
* Update the chunk db table with the current status:
*/
private function updateChunkStatus(){
wfDebug( __METHOD__ . " update chunk status for {$this->mFileKey} offset:" .
$this->getOffset() . ' inx:' . $this->getChunkIndex() . "\n" );
-
+
$dbw = $this->repo->getMasterDb();
$dbw->update(
'uploadstash',
__METHOD__
);
}
+
/**
* Get the chunk db state and populate update relevant local values
*/
$this->mVirtualTempPath = $row->us_path;
}
}
+
/**
* Get the current Chunk index
* @return Integer index of the current chunk
}
return 0;
}
-
+
/**
* Gets the current offset in fromt the stashedupload table
* @return Integer current byte offset of the chunk file set
}
return 0;
}
-
+
/**
* Output the chunk to disk
- *
+ *
* @param $chunkPath string
+ * @throws UploadChunkFileException
* @return FileRepoStatus
*/
private function outputChunk( $chunkPath ){
}
return $storeStatus;
}
+
private function getChunkFileKey( $index = null ){
if( $index === null ){
$index = $this->getChunkIndex();
/**
* @param $request WebRequest
- * @return null
*/
function initializeFromRequest( &$request ) {
- $upload = $request->getUpload( 'wpUploadFile' );
+ $upload = $request->getUpload( 'wpUploadFile' );
$desiredDestName = $request->getText( 'wpDestFile' );
- if( !$desiredDestName )
+ if( !$desiredDestName ) {
$desiredDestName = $upload->getName();
-
- return $this->initialize( $desiredDestName, $upload );
+ }
+
+ $this->initialize( $desiredDestName, $upload );
}
/**
* Initialize from a filename and a WebRequestUpload
* @param $name
* @param $webRequestUpload
- * @return null
*/
function initialize( $name, $webRequestUpload ) {
$this->mUpload = $webRequestUpload;
- return $this->initializePathInfo( $name,
+ $this->initializePathInfo( $name,
$this->mUpload->getTempName(), $this->mUpload->getSize() );
}
$this->stash = new UploadStash( $this->repo, $this->user );
}
-
- return true;
}
/**
*
* @param $user User
*
- * @return true|string
+ * @return bool|string
*/
public static function isAllowed( $user ) {
if ( !$user->isAllowed( 'upload_by_url' ) ) {
* @param $async mixed Whether the download should be performed
* asynchronous. False for synchronous, async or async-leavemessage for
* asynchronous download.
+ * @throws MWException
*/
public function initialize( $name, $url, $async = false ) {
global $wgAllowAsyncCopyUploads;
/**
* Wrapper around the parent function in order to defer checking protection
* until we are sure that the file can actually be uploaded
+ * @param $user User
* @return bool|mixed
*/
public function verifyTitlePermissions( $user ) {
/**
* Wrapper around the parent function in order to defer uploading to the
* job queue for asynchronous uploads
+ * @param $comment string
+ * @param $pageText string
+ * @param $watch bool
+ * @param $user User
* @return Status
*/
public function performUpload( $comment, $pageText, $watch, $user ) {
}
/**
- * @param $comment
- * @param $pageText
- * @param $watch
- * @param $user User
- * @return
+ * @param $comment
+ * @param $pageText
+ * @param $watch
+ * @param $user User
+ * @return String
*/
protected function insertJob( $comment, $pageText, $watch, $user ) {
$sessionKey = $this->stashSession();
class ConverterRule {
var $mText; // original text in -{text}-
var $mConverter; // LanguageConverter object
- var $mManualCodeError = '<strong class="error">code error!</strong>';
var $mRuleDisplay = '';
var $mRuleTitle = false;
var $mRules = '';// string : the text of the rules
}
}
if ( $this->mRuleDisplay === false ) {
- $this->mRuleDisplay = $this->mManualCodeError;
+ $this->mRuleDisplay = '<span class="error">'
+ . wfMessage( 'converter-manual-rule-error' )->inContentLanguage()->escaped()
+ . '</span>';
}
$this->generateConvTable();
'editundo' => 'скасаваць',
'diff-multi' => '($1 {{PLURAL:$1|прамежная вэрсія|прамежныя вэрсіі|прамежных вэрсіяў}} $2 {{PLURAL:$2|удзельніка|удзельнікаў|удзельнікаў}} {{PLURAL:$1|не паказаная|не паказаныя|не паказаныя}})',
'diff-multi-manyusers' => '($1 {{PLURAL:$1|прамежная вэрсія|прамежныя вэрсіі|прамежных вэрсіяў}} $2 {{PLURAL:$2|удзельніка|удзельнікаў|удзельнікаў}} {{PLURAL:$1|не паказаная|не паказаныя|не паказаныя}})',
+'difference-missing-revision' => '{{PLURAL:$2|Адна вэрсія|$2 вэрсіі}} з гэтымі адрозьненьнямі ($1) {{PLURAL:$2|не была|не былі}} знойдзеныя.
+
+Звычайна гэта здараецца з-за перахода па састарэлай спасылцы на старонку, якая была выдаленая.
+Падрабязнасьці можна знайсьці ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].',
# Search results
'searchresults' => 'Вынікі пошуку',
Això significa que si reanomeneu per equivocació una pàgina amb el seu nom anterior no ho podreu fer, ja que no es pot sobreescriure una pàgina existent.
-'''Avís:''' Això pot ser un canvi dràstic i inesperat per una pàgina popular; si us plau, assegureu-vos que sabeu el que féu abans de continuar.",
+'''Avís:''' Això pot ser un canvi dràstic i inesperat per una pàgina popular; si us plau, assegureu-vos que sabeu el que feu abans de continuar.",
'movepagetalktext' => "La pàgina de discussió associada, si existeix, serà traslladada automàticament '''tret dels següents casos''':
* Ja hi existeix una pàgina de discussió no buida amb el nou nom, o si
* la opció de davall es troba desactivada
* @author Aras Noori
* @author Arastein
* @author Asoxor
+ * @author Calak
* @author Cyrus abdi
* @author Diyar se
* @author Haval
لەیادت بێ کە لاپەڕەکانی .css و .js لە بابەت بە پیتی بچووک کەڵک وەر ئەگرن. وەک {{ns:user}}:Foo/vector.css نە وەک {{ns:user}}:Foo/Vector.css .",
'updated' => '(نوێکراوە)',
'note' => "'''تێبینی:'''",
-'previewnote' => "ە بیرت بێت کە ئەمە تەنھا پێشبینینە.'''
+'previewnote' => "'''لە بیرت نەچێت ئەمە تەنیا پێشبینینە.'''
گۆڕانکارییەکانت ھێشتا پاشەکەوت نەکراون!",
'previewconflict' => 'ئەم پێشبینینە بە تۆ نیشان ئەدات ئەو دەقەی لە شوێنی دەستکاری سەرەوە داتناوە چۆن بەرچاو ئەکەوێت ئەگەر پاشەکەوتی بکەیت.',
'session_fail_preview' => "'''ببوورە! ناتوانین دەستکارییەکەت پێواژۆ بکەین بە ھۆی لەدەستدانی session data.'''
'expansion-depth-exceeded-warning' => 'Die Seite hat die Expansionstiefe überschritten.',
'parser-unstrip-loop-warning' => 'Zirkelbezug festgestellt',
'parser-unstrip-recursion-limit' => 'Rekursionsgrenze beim Auflösen überschritten ($1)',
+'converter-manual-rule-error' => 'Bei der manuellen Sprachumwandlungsregel wurde ein Fehler entdeckt',
# "Undo" feature
'undo-success' => 'Die Bearbeitung kann rückgängig gemacht werden.
'youhavenewmessages' => 'You have $1 ($2).',
'newmessageslink' => 'new messages',
'newmessagesdifflink' => 'last change',
+'youhavenewmessagesfromusers' => 'You have $1 from {{PLURAL:$3|another user|$3 users}} ($2).',
+'youhavenewmessagesmanyusers' => 'You have $1 from many users ($2).',
+'newmessageslinkplural' => '{{PLURAL:$1|a new message|new messages}}', # don't rely on the value of $1, it's 1 for singular and 2 for "more than one"
+'newmessagesdifflinkplural' => 'last {{PLURAL:$1|change|changes}}', # don't rely on the value of $1, it's 1 for singular and 2 for "more than one"
'youhavenewmessagesmulti' => 'You have new messages on $1',
'newtalkseparator' => ', ', # do not translate or duplicate this message to other languages
'editsection' => 'edit',
'expansion-depth-exceeded-warning' => 'Page exceeded the expansion depth',
'parser-unstrip-loop-warning' => 'Unstrip loop detected',
'parser-unstrip-recursion-limit' => 'Unstrip recursion limit exceeded ($1)',
+'converter-manual-rule-error' => 'Error detected in manual language conversion rule',
# "Undo" feature
'undo-success' => 'The edit can be undone.
'duration-millennia' => '$1 {{PLURAL:$1|aastatuhande}}',
# Unknown messages
-'api-error-filetype-banned-type' => '$1 pole lubatud failitüü{{PLURAL:$4|p|bid}}. Lubatud {{PLURAL:$3|failitüüp|failitüübid}} on $2.',
+'api-error-filetype-banned-type' => '$1 pole lubatud {{PLURAL:$3|failitüüp|failitüübid}}. Lubatud {{PLURAL:$3|failitüüp|failitüübid}} on $2.',
);
'duration-millennia' => '$1 {{PLURAL:$1|millénaire|millénaires}}',
# Unknown messages
-'api-error-filetype-banned-type' => "''' « $1 » '''{{PLURAL:$4|n’est pas un type de fichier autorisé|ne sont pas des types de fichiers autorisés}}. {{PLURAL:$3|le type de fichier autorisé est |les types de fichiers autorisés sont}} $2.",
+'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|n’est pas un type de fichier autorisé|ne sont pas des types de fichiers autorisés}}. {{PLURAL:$3|Le type de fichier autorisé est |Les types de fichiers autorisés sont}} $2.',
);
'noarticletext-nopermission' => 'Actualmente non hai ningún texto nesta páxina.
Pode [[Special:Search/{{PAGENAME}}|procurar polo título desta páxina]] noutras páxinas
ou <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} ollar os rexistros relacionados]</span>.',
+'missing-revision' => 'A revisión nº$1 da páxina chamada "{{PAGENAME}}" non existe.
+
+A miúdo, isto está provocado por seguir unha ligazón de historial obsoleta cara a unha páxina que foi borrada.
+O [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} rexistro de borrados] contén máis detalles.',
'userpage-userdoesnotexist' => 'A conta do usuario "<nowiki>$1</nowiki>" non está rexistrada. Comprobe se desexa crear/editar esta páxina.',
'userpage-userdoesnotexist-view' => 'A conta de usuario "$1" non está rexistrada.',
'blocked-notice-logextract' => 'Este usuario está bloqueado.
'expansion-depth-exceeded-warning' => 'Páxina que supera a profundidade de expansión',
'parser-unstrip-loop-warning' => 'Detectouse un bucle inamovible',
'parser-unstrip-recursion-limit' => 'Excedeuse o límite de recursión inamovible ($1)',
+'converter-manual-rule-error' => 'Detectouse un erro na regra manual de conversión da lingua',
# "Undo" feature
'undo-success' => 'A edición pódese desfacer.
'editundo' => 'desfacer',
'diff-multi' => '(Non se {{PLURAL:$1|mostra unha revisión|mostran $1 revisións}} do historial {{PLURAL:$1|feita|feitas}} por {{PLURAL:$2|un usuario|$2 usuarios}}.)',
'diff-multi-manyusers' => '(Non se {{PLURAL:$1|mostra unha revisión|mostran $1 revisións}} do historial {{PLURAL:$1|feita|feitas}} por máis {{PLURAL:$2|dun usuario|de $2 usuarios}}.)',
+'difference-missing-revision' => 'Non se {{PLURAL:$2|atopou revisión ningunha|atoparon $2 revisións}} desta diferenza ($1).
+
+A miúdo, isto está provocado por seguir unha ligazón de diferenzas obsoleta cara a unha páxina que foi borrada.
+O [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} rexistro de borrados] contén máis detalles.',
# Search results
'searchresults' => 'Resultados da procura',
'disambiguations' => 'Páxinas que ligan con páxinas de homónimos',
'disambiguationspage' => 'Template:Homónimos',
-'disambiguations-text' => "As seguintes páxinas ligan cunha '''páxina de homónimos'''.
+'disambiguations-text' => "As seguintes páxinas conteñen, polo menos, unha ligazón cara a unha '''páxina de homónimos'''.
No canto de ligar cos homónimos deben apuntar cara á páxina apropiada.<br />
Unha páxina trátase como páxina de homónimos cando nela se usa un modelo que está ligado desde [[MediaWiki:Disambiguationspage]].",
או <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} לחפש ביומנים הרלוונטיים].</span>',
'missing-revision' => 'גרסה #$1 של הדף "{{PAGENAME}}" אינה קיימת.
-×\96×\94 ×\91×\93ר×\9a ×\9b×\9c×\9c × ×\92ר×\9d על־ידי לחיצה על קישור ישן לגרסה קודמת של דף שנמחק.
+×\96×\94 × ×\92ר×\9d ×\91×\93ר×\9a ×\9b×\9c×\9c על־ידי לחיצה על קישור ישן לגרסה קודמת של דף שנמחק.
אפשר למצוא פרטים ב[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} יומן המחיקות].',
'userpage-userdoesnotexist' => 'חשבון המשתמש "$1" אינו רשום.
אנא בדקו אם ברצונכם ליצור/לערוך דף זה.',
'editundo' => 'ביטול',
'diff-multi' => '({{PLURAL:$1|גרסת ביניים אחת|$1 גרסאות ביניים}} של {{PLURAL:$2|משתמש אחד|$2 משתמשים}} {{PLURAL:$1|אינה מוצגת|אינן מוצגות}})',
'diff-multi-manyusers' => '({{PLURAL:$1|גרסת ביניים אחת|$1 גרסאות ביניים}} של יותר {{PLURAL:$2|ממשתמש אחד|מ־$2 משתמשים}} {{PLURAL:$1|אינה מוצגת|אינן מוצגות}})',
-'difference-missing-revision' => '{{PLURAL:$2|גרסה אחת|$2 גרסאות}} של ההבדל הזה ($1) {{PLURAL:$2|לא נמצאה|לא נמצאו}}.
+'difference-missing-revision' => '{{PLURAL:$2|גרסה אחת|$2 גרסאות}} של ההבדל הזה בין שתי גרסאות ($1) {{PLURAL:$2|לא נמצאה|לא נמצאו}}.
-×\96×\94 ×\91×\93ר×\9a ×\9b×\9c×\9c × ×\92ר×\9d ×¢×\9cÖ¾×\99×\93×\99 ×\9c×\97×\99צ×\94 ×¢×\9c ק×\99ש×\95ר ×\9e×\99×\95ש×\9f ×\9c×\92רס×\94 ק×\95×\93×\9eת של דף שנמחק.
-×\90פשר ×\9c×\9eצ×\95×\90 פר×\98×\99×\9d ×\91[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} ×\99×\95×\9e×\9f ×\94×\9e×\97×\99ק×\94].',
+×\96×\94 × ×\92ר×\9d ×\91×\93ר×\9a ×\9b×\9c×\9c ×¢×\9cÖ¾×\99×\93×\99 ×\9c×\97×\99צ×\94 ×¢×\9c ק×\99ש×\95ר ×\99ש×\9f ×\9c×\94×\91×\93×\9c ×\91×\99×\9f ×\92רס×\90×\95ת של דף שנמחק.
+×\90פשר ×\9c×\9eצ×\95×\90 פר×\98×\99×\9d ×\91[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} ×\99×\95×\9e×\9f ×\94×\9e×\97×\99ק×\95ת].',
# Search results
'searchresults' => 'תוצאות החיפוש',
'tog-enotifminoredits' => 'էլ-փոստով տեղեկացնել էջերի նաև չնչին խմբագրումների մասին',
'tog-enotifrevealaddr' => 'Ցույց տալ իմ էլ-փոստի հասցեն ծանուցման նամակներում',
'tog-shownumberswatching' => 'Ցույց տալ էջ հսկող մասնակիցների թիվը',
-'tog-oldsig' => 'Առկա ստորագրության նախադիտում.',
+'tog-oldsig' => 'Ներկայիս ստորագրությունն է․',
'tog-fancysig' => 'Ստորագրությունը վիքիտեքստի տեսքով (առանց ավտոմատ հղման)',
'tog-externaleditor' => 'Օգտագործել արտաքին խմբագրիչ ըստ լռության (պահանջում է հատուկ նախընտրություններ ձեր համակարգչում)',
'tog-externaldiff' => 'Օգտագործել տարբերակների համեմատման արտաքին ծրագիր ըստ լռության (պահանջում է հատուկ նախընտրություններ ձեր համակարգչում)',
'tog-showjumplinks' => 'Միացնել «անցնել դեպի» օգնական հղումները',
'tog-uselivepreview' => 'Օգտագործել ուղիղ նախադիտում (JavaScript) (Փորձնական)',
-'tog-forceeditsummary' => 'Նախազգուշացնել փոփոխությունների ամփոփումը դատարկ թողնելու մասին',
+'tog-forceeditsummary' => 'Նախազգուշացնել խմբագրման ամփոփումը դատարկ թողնելու դեպքում',
'tog-watchlisthideown' => 'Թաքցնել իմ խմբագրումները հսկացանկից',
'tog-watchlisthidebots' => 'Թաքցնել բոտերի խմբագրումները հսկացանկից',
'tog-watchlisthideminor' => 'Թաքցնել չնչին խմբագրումները հսկացանկից',
'uploadnologintext' => 'Նիշքեր բեռնելու համար անհրաժեշտ է [[Special:UserLogin|մտնել համակարգ]]։',
'upload_directory_read_only' => 'Վեբ-սերվերը չունի գրելու իրավունք բեռնումների թղթապանակում ($1)։',
'uploaderror' => 'Բեռնման սխալ',
-'uploadtext' => '{{Բեռնել}}',
+'uploadtext' => "Նիշք բեռնելու համար օգտագործեք ստորև բերված ձևը։
+Նախկինում բեռնված նիշքերը դիտելու կամ որոնելու համար այցելեք [[Սպասարկող:Պատկերներիցանկը|բեռնված նիշքերի ցանկ]]։ Բեռնումները գրանցվում են [[Սպասարկող:Տեղեկամատյան/upload|բեռնման տեղեկամատյանում]], ջնջումները՝ [[Սպասարկող:Տեղեկամատյան/delete|ջնջման տեղեկամատյանում]]։
+
+Այս նիշքը որևէ էջում ընդգրկելու համար օգտագործեք հետևյալ հղման ձևերը.
+* '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Նիշք.jpg]]</nowiki>''' - ամբողջական չափի պատկեր տեղադրելու համար,
+* '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Նիշք.png|200px|thumb|left|այլ. տեքստ]]</nowiki>''' - 200 փիքսել լայնությամբ տարբերակը ձախ կողմում շրջանակի մեջ և «այլ․ տեքստ» բացատրությամբ տեղադրելու համար
+* '''<nowiki>[[</nowiki>{{ns:media}}<nowiki>:Նիշք.ogg]]</nowiki>''' - նիշքին ուղիղ հղման համար",
'uploadlog' => 'բեռնման տեղեկամատյան',
'uploadlogpage' => 'Բեռնման տեղեկամատյան',
'uploadlogpagetext' => 'Ստորև բերված է ամենավերջին բեռնված նիշքերի ցանկը։
'sp-contributions-deleted' => 'Մասնակցի ջնջված ներդրում',
'sp-contributions-uploads' => 'Բեռնումներ',
'sp-contributions-logs' => 'տեղեկամատյաններ',
-'sp-contributions-talk' => 'Քննարկում',
-'sp-contributions-userrights' => 'Õ\84ասնակիցների իրավունքների կառավարում',
+'sp-contributions-talk' => 'քննարկում',
+'sp-contributions-userrights' => 'Õ´ասնակիցների իրավունքների կառավարում',
'sp-contributions-search' => 'Որոնել ներդրումները',
'sp-contributions-username' => 'IP-հասե կամ մասնակցի անուն.',
'sp-contributions-toponly' => 'Ցույց տալ միայն այն խմբագրումները, որոնք վերջին փոփոխություն են',
'noarticletext-nopermission' => 'Al momento il non ha texto in iste pagina.
Tu pote [[Special:Search/{{PAGENAME}}|cercar le titulo de iste pagina]] in altere paginas,
o <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} cercar in le registros pertinente].</span>',
+'missing-revision' => 'Le version №$1 del pagina nominate "{{PAGENAME}}" non existe.
+
+Isto es generalmente causate per sequer un ligamine de historia obsolete a un pagina que ha essite delite.
+Detalios se trova in le [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de deletiones].',
'userpage-userdoesnotexist' => 'Le conto de usator "<nowiki>$1</nowiki>" non es registrate. Per favor verifica que tu vole crear/modificar iste pagina.',
'userpage-userdoesnotexist-view' => 'Le conto de usator "$1" non es registrate.',
'blocked-notice-logextract' => 'Iste usator es actualmente blocate.
'expansion-depth-exceeded-warning' => 'Le profunditate de expansion in iste pagina excede le limite',
'parser-unstrip-loop-warning' => 'Bucla de "unstrip" detegite',
'parser-unstrip-recursion-limit' => 'Limite de recursion de "unstrip" excedite ($1)',
+'converter-manual-rule-error' => 'Error detegite in le regula manual de conversion de lingua',
# "Undo" feature
'undo-success' => 'Le modification pote esser disfacite.
'editundo' => 'disfacer',
'diff-multi' => '({{PLURAL:$1|Un version intermedie|$1 versiones intermedie}} facite per {{PLURAL:$2|un usator|$2 usatores}} non es monstrate)',
'diff-multi-manyusers' => '({{PLURAL:$1|Un version intermedie|$1 versiones intermedie}} facite per plus de $2 {{PLURAL:$2|usator|usatores}} non es monstrate)',
+'difference-missing-revision' => '{{PLURAL:$2|Un version|$2 versiones}} de iste differentia ($1) non ha essite trovate.
+
+Isto es generalmente causate per sequer un ligamine de diff obsolete a un pagina que ha essite delite.
+Detalios se trova in le [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} registro de deletiones].',
# Search results
'searchresults' => 'Resultatos del recerca',
'disambiguations' => 'Paginas con ligamines a paginas de disambiguation',
'disambiguationspage' => 'Template:Disambiguation',
-'disambiguations-text' => "Le sequente paginas ha ligamines a un '''pagina de disambiguation'''.
-Istes deberea esser reimplaciate con ligamines al topicos appropriate.<br />
-Un pagina se tracta como pagina de disambiguation si illo usa un patrono al qual [[MediaWiki:Disambiguationspage]] ha un ligamine.",
+'disambiguations-text' => "Le sequente paginas contine al minus un ligamine a un '''pagina de disambiguation'''.
+Istes debe forsan ligar directemente al articulo sur le thema in question.<br />
+Un pagina se tracta como pagina de disambiguation si illo usa un patrono que es ligate ab [[MediaWiki:Disambiguationspage]].",
'doubleredirects' => 'Redirectiones duple',
'doubleredirectstext' => 'Iste pagina lista paginas de redirection verso altere paginas de redirection.
'revdelete-offender' => 'Autore della versione:',
# Suppression log
-'suppressionlog' => 'Log delle soppressioni',
+'suppressionlog' => 'Soppressioni',
'suppressionlogtext' => "Di seguito sono elencate le cancellazioni e i blocchi con del contenuto nascosto agli amministratori.
Vedi l'[[Special:BlockList|elenco dei blocchi]] per l'elenco dei bandi e dei blocchi attivi al momento.",
# Groups
'group' => 'グループ:',
-'group-user' => '利用者',
+'group-user' => '登録利用者',
'group-autoconfirmed' => '自動承認された利用者',
'group-bot' => 'ボット',
'group-sysop' => '管理者',
'group-suppress' => '秘匿者',
'group-all' => '(全員)',
-'group-user-member' => '{{GENDER:$1|利用者}}',
+'group-user-member' => '{{GENDER:$1|登録利用者}}',
'group-autoconfirmed-member' => '{{GENDER:$1|自動承認された利用者}}',
'group-bot-member' => '{{GENDER:$1|ボット}}',
'group-sysop-member' => '{{GENDER:$1|管理者}}',
'group-bureaucrat-member' => '{{GENDER:$1|ビューロクラット}}',
'group-suppress-member' => '{{GENDER:$1|秘匿者}}',
-'grouppage-user' => '{{ns:project}}:利用者',
+'grouppage-user' => '{{ns:project}}:登録利用者',
'grouppage-autoconfirmed' => '{{ns:project}}:自動承認された利用者',
'grouppage-bot' => '{{ns:project}}:ボット',
'grouppage-sysop' => '{{ns:project}}:管理者',
'api-error-fileexists-shared-forbidden' => '"$1" 이름으로 된 파일이 이미 공용 저장소에 존재하며 덮어쓸 수 없습니다.',
'api-error-file-too-large' => '당신이 올리려는 파일이 너무 큽니다.',
'api-error-filename-tooshort' => '파일 이름이 너무 짧습니다.',
-'api-error-filetype-banned' => 'ì\9d´ë\9f° í\98\95ì\8b\9dì\9d\98 í\8c\8cì\9d¼은 올릴 수 없습니다.',
+'api-error-filetype-banned' => 'ì\9d´ë\9f° í\8c\8cì\9d¼ í\98\95ì\8b\9d은 올릴 수 없습니다.',
'api-error-filetype-missing' => '파일 이름에 확장자가 없습니다.',
'api-error-hookaborted' => '당신이 시도한 수정이 확장 기능 훅에 의해 중단되었습니다.',
'api-error-http' => '내부 오류: 서버에 연결할 수 없습니다.',
'duration-millennia' => '$1{{PLURAL:$1|천년}}',
# Unknown messages
-'api-error-filetype-banned-type' => '{{PLURAL:$3$4}}$1 형식의 파일은 올릴 수 없습니다. $2 형식만 사용할 수 있습니다.',
+'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|파일 형식은 올릴 수 없습니다}}. $2 {{PLURAL:$3|파일 형식만 사용할 수 있습니다}}.',
);
'disambiguations' => 'Säiten déi op Homonymie-Säite linken',
'disambiguationspage' => 'Template:Homonymie',
-'disambiguations-text' => 'Dës Säite si mat enger Homonymie-Säit verlinkt.
-Sie sollten am beschten op déi eigentlech gemengte Säit verlinkt sinn.<br />
-Eng Säite gëtt als Homonymiesäit behandelt, wa si eng Schabloun benotzt déi vu [[MediaWiki:Disambiguationspage]] verlinkt ass.',
+'disambiguations-text' => "Dës Säite ass mat mindestens enger '''Homonymie-Säit''' verlinkt.
+Si sollte am beschten op déi eigentlech gemengte Säit verlinkt sinn.<br />
+Eng Säite gëtt als Homonymie-Säit behandelt, wa si eng Schabloun benotzt déi vu [[MediaWiki:Disambiguationspage]] verlinkt ass.",
'doubleredirects' => 'Duebel Viruleedungen',
'doubleredirectstext' => 'Op dëser Säit stinn déi Säiten déi op aner Viruleedungssäite viruleeden.
'rollback' => 'Ännerungen zrécksetzen',
'rollback_short' => 'Zrécksetzen',
'rollbacklink' => 'Zrécksetzen',
+'rollbacklinkcount' => '{{PLURAL:$1|Eng Ännerung|$1 Ännerungen}} zerécksetzen',
+'rollbacklinkcount-morethan' => 'méi wéi {{PLURAL:$1|Eng Ännerung|$1 Ännerungen}} zerécksetzen',
'rollbackfailed' => 'Zrécksetzen huet net geklappt',
'cantrollback' => 'Lescht Ännerung kann net zréckgesat ginn. De leschten Auteur ass deen eenzegen Auteur vun dëser Säit.',
'alreadyrolled' => 'Déi lescht Ännerung vun der Säit [[:$1]] vum [[User:$2|$2]] ([[User talk:$2|talk]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]);; kann net zeréckgesat ginn;
'duration-millennia' => '$1 {{PLURAL:$1|Millenaire|Millenairen}}',
# Unknown messages
-'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|is not a permitted file type|si Fichiersformater déi net erlaabt sinn}}. Erlaabt {{PLURAL:$3|ass|sinn}}: $2.',
+'api-error-filetype-banned-type' => "$1 {{PLURAL:$4|ass e Fichiersformat deen net erlaabt ass|si Fichiersformater déi net erlaabt sinn}}. Erlaabt {{PLURAL:$3|ass de Fichiersformat|sinn d'Fichiersformater}}: $2.",
);
'noarticletext-nopermission' => 'Нема текст на оваа страница.
Можете да го [[Special:Search/{{PAGENAME}}|пребарате овој наслов]] во други страници,
или да ги <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} пребарате соодветните дневници]</span>.',
+'missing-revision' => 'Не ја пронајдов ревизијата бр. $1 на страницата со наслов „{{PAGENAME}}“.
+
+Ова обично се должи на застарена врска за разлики што води кон избришана страница.
+Повеќе подробности ќе најдете во [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} дневникот на бришења].',
'userpage-userdoesnotexist' => 'Корисничката сметка „<nowiki>$1</nowiki>“ не е регистрирана.
Ве молиме размислете дали навистина сакате да ја создадете/уредите оваа страница.',
'userpage-userdoesnotexist-view' => 'Корисничката сметка „$1“ не е регистрирана.',
'editundo' => 'откажи',
'diff-multi' => '({{PLURAL:$1|Не е прикажана една меѓувремена ревизија|Не се прикажани $1 меѓувремени ревизии}} од {{PLURAL:$2|еден корисник|$2 корисници}})',
'diff-multi-manyusers' => '({{PLURAL:$1|Не е прикажана една меѓувремена ревизија направена|Не се прикажани $1 меѓувремени ревизии направени}} од повеќе од $2 {{PLURAL:$2|корисник|корисници}})',
+'difference-missing-revision' => 'Не пронајдов {{PLURAL:$2|една ревизија|$2 ревизии}} од оваа разлика ($1).
+
+Ова обично се должи на застарена врска за разлики што води кон избришана страница.
+Повеќе подробности ќе најдете во [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} дневникот на бришења].',
# Search results
'searchresults' => 'Резултати од пребарувањето',
'duration-millennia' => '$1 {{PLURAL:$1|милениум|милениуми}}',
# Unknown messages
-'api-error-filetype-banned-type' => '$1 не е допуштен тип на податотека. {{PLURAL:$3|Допуштен тип е|Допуштени типови се}} $2.',
+'api-error-filetype-banned-type' => '$1 не {{PLURAL:$4|е допуштен тип на податотека|се допуштени типови на податотека}}. {{PLURAL:$3|Допуштен е|Допуштени се}} $2.',
);
'noarticletext-nopermission' => 'ഇപ്പോൾ ഈ താളിൽ എഴുത്തുകളൊന്നും ഇല്ല.
താങ്കൾക്ക് മറ്റു താളുകളിൽ [[Special:Search/{{PAGENAME}}|ഈ താളിന്റെ തലക്കെട്ടിനായി തിരയാവുന്നതാണ്]],
അല്ലെങ്കിൽ <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} ബന്ധപ്പെട്ട രേഖകൾ പരിശോധിക്കാവുന്നതാണ്]</span>.',
+'missing-revision' => '"{{PAGENAME}}" എന്ന താളിന്റെ #$1 എന്ന നാൾപ്പതിപ്പ് നിലവിലില്ല.
+
+മായ്ക്കപ്പെട്ട താളിന്റെ കാലഹരണപ്പെട്ട നാൾവഴി കണ്ണി ഉപയോഗിച്ചാലാണ് സാധാരണ ഇങ്ങനെ സംഭവിക്കുക.
+കൂടുതൽ വിവരങ്ങൾ [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} മായ്ക്കൽ രേഖയിൽ] കാണാവുന്നതാണ്.',
'userpage-userdoesnotexist' => '"<nowiki>$1</nowiki>" എന്ന ഉപയോക്താവ് അംഗത്വമെടുത്തിട്ടില്ല. ഈ താൾ സൃഷ്ടിക്കണമോ എന്നതു പരിശോധിക്കുക.',
'userpage-userdoesnotexist-view' => '"$1" എന്ന അംഗത്വം നിലവിലില്ല.',
'blocked-notice-logextract' => 'ഈ ഉപയോക്താവ് ഇപ്പോൾ തടയപ്പെട്ടിരിക്കുകയാണ്.
'editundo' => 'മാറ്റം തിരസ്ക്കരിക്കുക',
'diff-multi' => '(ഇടയ്ക്ക് {{PLURAL:$2|ഒരു ഉപയോക്താവ്|$2 ഉപയോക്താക്കൾ}} ചെയ്ത {{PLURAL:$1|ഒരു പതിപ്പ്|$1 പതിപ്പുകൾ}} പ്രദർശിപ്പിക്കുന്നില്ല.)',
'diff-multi-manyusers' => '(ഇടയ്ക്ക് {{PLURAL:$2|ഒന്നിലധികം|$2 എണ്ണത്തിലധികം}} ഉപയോക്താക്കൾ ചെയ്തിട്ടുള്ള {{PLURAL:$1|ഒരു പതിപ്പ്|$1 പതിപ്പുകൾ}} പ്രദർശിപ്പിക്കുന്നില്ല.)',
+'difference-missing-revision' => 'ഈ വ്യത്യാസത്തിൽ ($1) {{PLURAL:$2|ഒരു നാൾപ്പതിപ്പ്|$2 നാൾപ്പതിപ്പുകൾ}} കാണാനായില്ല.
+
+മായ്ക്കപ്പെട്ട താളിന്റെ കാലഹരണപ്പെട്ട നാൾവഴി കണ്ണി ഉപയോഗിച്ചാലാണ് സാധാരണ ഇങ്ങനെ സംഭവിക്കുക.
+കൂടുതൽ വിവരങ്ങൾ [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} മായ്ക്കൽ രേഖയിൽ] കാണാവുന്നതാണ്.',
# Search results
'searchresults' => 'തിരച്ചിലിന്റെ ഫലം',
'disambiguations' => 'Páginas com ligações para páginas de desambiguação',
'disambiguationspage' => 'Template:disambig',
-'disambiguations-text' => 'As páginas abaixo contêm links para uma página de desambiguação.
-Estes links deviam ser desambiguados, apontando-os para a página apropriada.<br />
-Considera-se que uma página é de desambiguação se nela for utilizada uma predefinição que esteja definida em [[MediaWiki:Disambiguationspage]].',
+'disambiguations-text' => "As páginas abaixo contêm pelo menos um link para uma '''página de desambiguação'''.
+Estes links deviam ser desambiguados, apontando-os para uma página mais apropriada.<br />
+Considera-se que uma página é de desambiguação se nela for utilizada uma predefinição que esteja definida em [[MediaWiki:Disambiguationspage]].",
'doubleredirects' => 'Redireccionamentos duplos',
'doubleredirectstext' => 'Esta página lista todas as páginas que redireccionam para outras páginas de redireccionamento.
{{Identical|New messages}}',
'newmessagesdifflink' => 'This is the second link displayed in an orange rectangle when a user gets a message on his talk page. Used in message {{msg-mw|youhavenewmessages}} (as parameter $2).',
+'youhavenewmessagesfromusers' => 'New talk inidcator message: the message appearing when someone edited your user talk page.
+The message takes three parameters, {{msg-mw|newmessageslinkplural}}, {{msg-mw|newmessagesdifflinkplurl}}, and the number of authors
+that have edited the talk page since the owning user last viewed it.',
+'youhavenewmessagesmanyusers' => 'New talk inidcator message: the message appearing when someone edited your user talk page.
+Like {{msg-mw|youhavenewmessages}}, but getting {{msg-mw|newmessageslinkplural}} and {{msg-mw|newmessagesdifflinkplurl}} as parameters $1 and $2, respectively. Used when more than 10 users
+edited the user talk page since the owning user last viewed it.',
+'newmessageslinkplural' => 'Like {{msg-mw|newmessageslink}} but supporting pluralization. Used in message {{msg-mw|youhavenewmessagesfromusers}} (as parameter $1).
+This message itself takes one parameter, $1, which is 1 if there was one new edit, or 2 if there was more than one new edit
+since the last time the user has seen his or her talk page.',
+'newmessagesdifflinkplural' => 'Like {{msg-mw|newmessagesdifflink}} but supporting pluralization. Used in message {{msg-mw|youhavenewmessagesfromusers}} (as parameter $2).
+This message itself takes one parameter, $1, which is 1 if there was one new edit, or 2 if there was more than one new edit
+since the last time the user has seen his or her talk page.',
'youhavenewmessagesmulti' => 'The alternative of {{msg|youhavenewmessages}} as used on wikis with a special setup so they can receive the "new message" notice on other wikis as well. Used on [http://www.wikia.com/ Wikia].
The format is: "{{int:youhavenewmessagesmulti| [[MediaWiki:Newmessageslink/{{SUBPAGENAME}}|{{int:newmessageslink}}]]}}"',
'editsection' => 'Display name of link to edit a section on a content page. Example: [{{MediaWiki:Editsection}}].
"Unstrip" refers to the internal function of the parser, called \'unstrip\', which recursively puts the output of parser functions in the place of the parser function call and which would enter an infinite loop in the situation above. See also:
*{{msg-mw|Parser-unstrip-loop-warning}}',
+'converter-manual-rule-error' => "This message is shown when a manual conversion rule for the language converter has errors. For example it's not using the correct syntax, or not supplying text in all variants.",
# "Undo" feature
'undo-success' => 'Text on special page to confirm edit revert. You arrive on this page by clicking on the "undo" link on a revision history special page.
'readonlytext' => 'Baza de date {{SITENAME}} este momentan blocată la scriere, probabil pentru o operațiune de rutină, după care va fi deblocată și se va reveni la starea normală.
Administratorul care a blocat-o a oferit această explicație: $1',
-'missing-article' => 'Baza de date nu găsește textul unei pagini care ar fi trebuit găsit, numit „$1” $2.
+'missing-article' => 'Baza de date nu găsește textul unei pagini care ar fi trebuit găsită, numită „$1” $2.
-În mod normal faptul este cauzat de urmărirea unei dif neactualizată sau a unei legături din istoric spre o pagină care a fost ștearsă.
+În mod normal faptul este cauzat de accesarea unei dif neactualizată sau a unei legături din istoric spre o pagină care a fost ștearsă.
Dacă nu acesta e motivul, s-ar putea să fi găsit un bug în program.
-Te rog anunță acest aspect unui [[Special:ListUsers/sysop|administrator]], indicându-i adresa URL.',
+Vă rugăm să-i semnalați acest aspect unui [[Special:ListUsers/sysop|administrator]], indicându-i adresa URL.',
'missingarticle-rev' => '(versiunea#: $1)',
'missingarticle-diff' => '(Dif: $1, $2)',
'readonly_lag' => 'Baza de date a fost închisă automatic în timp ce serverele secundare ale bazei de date îl urmează pe cel principal.',
'duration-millennia' => '$1 {{PLURAL:$1|mileniu|milenii|de milenii}}',
# Unknown messages
-'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|este un tip de fișier nepermis|sunt tipuri de fișier nepermise}}. {{PLURAL:$3|Tip de fișier permis:|Tipuri de fișier permise:}} $2.',
+'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|este un tip de fișier nepermis|sunt tipuri de fișier nepermise}}. {{PLURAL:$3|Tip de fișier permis este|Tipuri de fișier permise sunt}} $2.',
);
'watchmethod-list' => 'सद्यः सम्पादनार्थम् अवलोकितपुटानां परीक्षणम् ।',
'watchlistcontains' => 'भवतः अवलोकनावली $1 युक्तास्ति ।{{PLURAL:$1|page|pages}}.',
'iteminvalidname' => "समस्या '$1' इत्यनेन अस्ति । अमान्यं नाम ।",
-'wlnote' => "अधस्तात् {{PLURAL:$1|'''1''' परिवर्तनमस्ति|अन्तिमानि '''$1''' परिवर्तनानि सन्ति}},{{PLURAL:$2|गते दिवसे|'''$2''' गतेषु दिवसेषु}}, $5, $4 इति समये।",
+'wlnote' => "अधस्तात् {{PLURAL:$1|'''1''' परिवर्तनमस्ति|अन्तिमानि '''$1''' परिवर्तनानि सन्ति}},{{PLURAL:$2|गते दिवसे|'''$2''' गतेषु दिवसेषु}}, , $3, $4. इति",
'wlshowlast' => 'अन्तिमानि ($1 होराः $2 दिनानि) $3 इति दर्श्यन्ताम्',
'watchlist-options' => 'अवेक्षणसूच्याः विकल्पाः',
'created' => 'सृष्टम् ।',
'enotif_subject' => '{{SITENAME}} $ पुटशीर्षकं $ परिवर्तितम्$ इत्यनेन ।',
'enotif_lastvisited' => 'भवतः पूवसन्दर्शनस्य पश्चात् सवृत्तपरिवर्तनार्थं $1 पश्यतु ।',
+'enotif_lastdiff' => 'एतत्परिवर्तनं दृष्टुं $1 पश्यतु ।',
+'enotif_anon_editor' => 'अनामकः योजकः $1',
+'enotif_body' => 'आत्मीय $ अवलोकनबन्धो',
# Delete
'deletepage' => 'पृष्ठं निराकरोतु।',
'confirm' => 'स्थिरीकरोतु',
+'excontent' => '"$1" आधेयः आसीत् ।',
+'excontentauthor' => 'आधेयः $1आसीत् । अपि च योगदाता तु "[[Special:Contributions/$2|$2]]" आसीत् ।',
+'exbeforeblank' => 'रिक्तीकरणात् पूर्वम् आधेयः "$1" आसीत् ।',
+'exblank' => 'पुटं रिक्तमासीत् ।',
'delete-confirm' => 'विलुप्यताम् "$1"',
'delete-legend' => 'विलुप्यताम्',
+'historywarning' => "' पूर्वसूचना ''' भवता अपमर्जनसिद्धपुटे बहुशः $1 इतिहासयुक्तः अस्ति ।{{PLURAL:$1|revision|revisions}}:",
'confirmdeletetext' => 'भवान् एकं पृष्ठं तस्य अखिलेन इतिहासेन सहितं अपाकर्तुं प्रवृत्तोऽस्ति। कृपया सुपुष्टीकरोतु यत् भवतः एतदेव आशयः, यद् भवता अस्य परिणामाः सुविज्ञाताः सन्ति तथा च भवता क्रियैषा [[{{MediaWiki:Policy-url}}| यथानीति]] सम्पाद्यते।',
'actioncomplete' => 'कार्यं सम्पन्नम्',
'actionfailed' => 'कर्मन् रिष्ट',
'deletedtext' => '"$1" इत्येतद् अपाकृतमस्ति।
सद्यःकृतानां अपाकरणानाम् अभिलेखः $2 इत्यस्मिन् पश्यतु।',
'dellogpage' => 'अपाकरणानां सूचिका',
+'dellogpagetext' => 'सद्यः कालीनापमर्जितपुटानाम् आवली अधः अस्ति ।',
+'deletionlog' => 'अपमर्जनसूचिका ।',
+'reverted' => 'प्राचीनपुनरावृत्तिः पूर्ववत् कृता ।',
'deletecomment' => 'कारणम् :',
'deleteotherreason' => 'अपरं/अतिरिक्तं कारणम् :',
'deletereasonotherlist' => 'इतर कारणम्',
+'deletereason-dropdown' => '*अपमर्जनस्य सामान्यकारणानि ।
+** लेखकस्य निवेदनम् ।
+** कृतिस्वाम्यस्य उल्लङ्घनम् ।
+** नाशकत्वम् ।',
+'delete-edit-reasonlist' => 'अपमार्जनकारणानि सम्पादयतु ।',
+'delete-toobig' => 'अस्य पुटास्य सम्पादनेतिहासः$1तः अधिकः {{PLURAL:$1|पुनरावृत्तिः}} इति कारणेन बृहत् अस्ति ।
+{{SITENAME}} इत्यस्य अकस्मात् प्रविदारणम् अवरोद्धुं तादृशपुटस्य अपमर्जनं निषिद्धम् ।',
+'delete-warning-toobig' => ' $1 {{PLURAL:$1|पुनरावृत्तिः|पुनरावृत्तयः}} अस्मिन् पुटे विसृतः सम्पादनेतिहासः ।',
# Rollback
+'rollback' => 'सम्पादनं निर्वर्तयतु ।',
+'rollback_short' => 'प्रत्याहरणम् ।',
'rollbacklink' => 'प्रतिनिवर्त्यताम्',
+'rollbacklinkcount' => '$1 {{PLURAL:$1|सम्पादनम्|सम्पादनानि}} प्रत्याहरतु ।',
+'rollbacklinkcount-morethan' => '$1 {{PLURAL:$1|सम्पादनम्|सम्पादनानि}} अधिकं प्रत्याहरतु ।',
+'rollbackfailed' => 'प्रत्यहरणम् असफलम् ।',
+'cantrollback' => 'सम्पादनं पूर्ववत् प्रत्यानेतुं न शक्यते ।
+गतयोजकः केवलम् अस्यपुटस्य कर्ता ।',
+'alreadyrolled' => '[[User:$2|$2]] ([[User talk:$2|वार्ता]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]) द्वारा कृतम् [[:$1]] इत्यस्य गतसम्पादनं पूर्वतनस्थितौ प्रत्याहरणं न शक्यते । अत्रान्तरे कोऽप्यन्यः एतत्पुटं पुनस्सम्पादितवान् अथवा पूर्वमेव प्राचीनस्थितौ आनीतम् अस्ति ।
+अस्य पुटास्य अन्तिमसम्पादनं [[User:$3|$3]] ([[User talk:$3|वार्ता]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]) इत्यनेन कृतम् ।',
+'editcomment' => "\"''\$1''\" इति सम्पादनसारः आसीत् ।",
+'revertpage' => '[[Special:Contributions/$2|$2]] ([[User talk:$2|Talk]])इत्यस्य सम्पादनम् अपमर्ज्य [[User:$1|$1]] इति अन्तिमपुनरावृत्तिः ।',
+'revertpage-nouser' => '(योजकस्य नाम अपनीतम्) द्वारा कृतसम्पादनं पूर्वस्थितौ प्रत्याहृत्य तत्पूर्वतनस्य [[User:$1|$1]] द्वारा कृतपुनरावृत्तेः नूतनावृत्तिः कृता ।',
+'rollback-success' => '$1 इत्यस्य सम्पादनम् अपनयतु ।
+$2 द्वारा सम्पादितां अन्तिमावृत्तिं पुनस्थापयतु ।',
+
+# Edit tokens
+'sessionfailure-title' => 'सत्रस्य वैफल्यम् ।',
+'sessionfailure' => 'भवतः प्रवेशत्रेण सह कापि समस्या अस्ति इति भाति ।
+सत्रापहरणात् रक्षणस्य सावधानार्थं भवतः क्रियाकलापः अपनीतः ।
+निर्गत्य पूर्वपुटं गत्वा पुनः गत्वा प्रयत्नं करोतु ।',
# Protect
'protectlogpage' => 'सुरक्षासूची',
+'protectlogtext' => 'अधो दत्ता सुरक्षार्थं कृतपरिवर्ननानां सूचिका अस्ति ।
+वरतमानस्य सुरक्षितपुटानां सूचिकार्थम् अत्र [[Special:ProtectedPages|सुरक्षितपुटानां सूचिका]] पश्यतु ।',
'protectedarticle' => '"[[$1]]" इत्येतद् संरक्षितमस्ति',
'modifiedarticleprotection' => '"[[$1]]" इत्येतदर्थं सुरक्षा-स्तरः परिवर्तित: :',
+'unprotectedarticle' => '"[[$1]]"तः सुरक्षा अपमर्जिता ।',
+'movedarticleprotection' => 'सुरक्षणस्य स्तरः "[[$2]]" तः परिवर्त्य "[[$1]]" कृतः अस्ति ।',
+'protect-title' => '[[$1]] इत्येतदर्थं सुरक्षा-स्तरः परिवर्तित: :',
+'protect-title-notallowed' => '"$1" इत्यस्य सुरक्षास्तरं पश्यतु ।',
+'prot_1movedto2' => '[[$1]] इत्यस्य नामपरिवर्तनं कृत्वा [[$2]] इति कृतम् ।',
+'protect-badnamespace-title' => 'असुरक्षितं नामस्थानम् ।',
+'protect-badnamespace-text' => 'अस्मिन् नामस्थाने पुटानि सुरक्षितानि न भवन्ति ।',
+'protect-legend' => 'सुरक्षां दृढयतु ।',
'protectcomment' => 'कारणम् :',
'protectexpiry' => 'अवसानम् :',
'protect_expiry_invalid' => 'अवसान-समयः अमान्योऽस्ति।',
'protect_expiry_old' => 'अवसान-समयः अतीतोऽस्ति।',
+'protect-unchain-permissions' => 'अग्रिमान् सुरक्षाविकल्पान् निर्तालयतु ।',
'protect-text' => "'''$1''' इति पृष्ठस्य कृते सुरक्षा-स्तरं भवान् अत्र दृष्टुं शक्नोति, तथा च तं परिवर्तयितुं शक्नोति।",
+'protect-locked-blocked' => "भवान् सुरक्शणस्य स्तरं परिवर्तयितुं नैव शक्नोति ।
+'''$1'' इति पुटस्य वर्तमाना स्थितिः एषा अस्ति ।",
+'protect-locked-dblock' => "सक्रियेन दत्तपाठतालनेन सुरक्षापत्राणि परिवर्तयितुं न शक्यते ।
+'''$1''' इत्यस्य वर्तमाना स्थितिः एषा अस्ति ।",
'protect-locked-access' => "भवान् अस्य पृष्ठस्य सुरक्षा-स्तरं परिवर्तयितुम् अनुज्ञां न धारयति। '''$1''' इति पृष्ठस्य अधुनातनः सुरक्षा-स्तरः :",
'protect-cascadeon' => 'इदं पृष्ठं वर्तमत्काले सुरक्षितमस्ति, यत इदं {{PLURAL:$1|निम्नलिखिते पृष्ठे |निम्नलिखितेषु पृष्ठेषु}} समाहितमस्ति {{PLURAL:$1|यस्मिन्|येषु}} सोपानात्मिका सुरक्षा प्रभाविनी अस्ति। भवान् अस्य पृष्ठस्य सुरक्षा-स्तरं परिवर्तयितुं शक्नोति, परं तेन सोपानात्मिका-सुरक्षा न परिवर्तयिष्यति।',
'protect-default' => 'सर्वान् प्रयोक्तॄन् अनुज्ञापयतु।',
'protect-level-sysop' => 'प्रबंधकाः केवलाः',
'protect-summary-cascade' => 'सोपानात्मकम्',
'protect-expiring' => 'अवसानम् $1 (UTC)',
+'protect-expiring-local' => '$1 अपनीतम् ।',
'protect-expiry-indefinite' => 'अनिश्चितकालः',
'protect-cascade' => 'अस्मिन् पृष्ठे समाहितानि पृष्ठाणि सुरक्षितानि करोतु (सोपानात्मिका सुरक्षा)।',
'protect-cantedit' => 'भवान् अस्य पृष्ठस्य सुरक्षा-स्तरं परिवर्तयितुं न शक्नोति, यतो भवान् इदं पृष्ठं संपादयितुं अनुज्ञां न धारयति।',
+'protect-othertime' => 'अन्यः समयः ।',
+'protect-othertime-op' => 'अन्यः समयः :',
+'protect-existing-expiry' => 'विद्यमानः समाप्तिसमयः $3, $2',
+'protect-otherreason' => 'अपरं/अतिरिक्तं कारणम् :',
'protect-otherreason-op' => 'इतर कारणम्',
'restriction-type' => 'अनुमतिः:',
'restriction-level' => 'सुरक्षा-स्तरः :',
Správca, ktorý nariadil uzamknutie, uvádza tento dôvod: $1',
'missing-article' => 'Text stránky s názvom „$1” $2, ktorú ste požadovali, nebol nájdený v databáze.
-To sa zvyčajne stane, keď kliknete na zastaralý odkaz na rozdiel alebo do histórie stránky, ktorá bola zmazaná.
+To sa zvyčajne stane, keď kliknete na zastaraný odkaz na rozdiel alebo do histórie stránky, ktorá bola zmazaná.
Ak to tak nie je, je možné, že ste našli chybu v softvéri.
Oznámte to prosím [[Special:ListUsers/sysop|správcovi]] a uveďte URL.',
'noarticletext-nopermission' => 'Táto stránka momentálne neobsahuje žiadny text.
Môžete [[Special:Search/{{PAGENAME}}|hľadať názov tejto stránky]] v texte iných stránok
alebo <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} si pozrieť súvisiace záznamy]</span>.',
+'missing-revision' => 'Revízia #$1 stránky s názvom „{{PAGENAME}}“ neexistuje.
+
+Pravdepodobne ste nasledovali zastaraný odkaz na historickú verziu stránky, ktorá bola medzičasom odstránená.
+Podrobnosti nájdete v [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zázname zmazaní].',
'userpage-userdoesnotexist' => 'Používateľský účet „<nowiki>$1</nowiki>“ nie je registrovaný. Prosím, skontrolujte, či naozaj chcete vytvoriť/upravovať túto stránku.',
'userpage-userdoesnotexist-view' => 'Používateľský účet „$1“ nie je registrovaný.',
'blocked-notice-logextract' => 'Tento používateľ je momentálne zablokovaný.
'editundo' => 'vrátiť',
'diff-multi' => '{{PLURAL:$1|Jedna medziľahlá revízia|$1 medziľahlé revízie|$1 medziľahlých revízií}} od {{PLURAL:$2|jedného používateľa|$2 používateľov}} {{PLURAL:$1|nie je zobrazená|nie sú zobrazené|nie je zobrazených}}.',
'diff-multi-manyusers' => '({{PLURAL:$1|$1 medziľahlá revízia|$1 medziľahlé revízie|$1 medziľahlých revízií}} od viac ako {{PLURAL:$2|$2 používateľa|$2 používateľov}} {{PLURAL:$1|nie je zobrazená|nie sú zobrazené|nie je zobrazených}})',
+'difference-missing-revision' => '{{PLURAL:$2|$2 revízia|$2 revízie|$2 revízií}} pre požadovaný rozdiel ($1) {{PLURAL:$2|neexistuje|neexistujú|neexistuje}}.
+
+Pravdepodobne ste nasledovali zastaraný odkaz na rozdiel revízií, z ktorých niektorá bola medzičasom odstránená.
+Podrobnosti nájdete v [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zázname zmazaní].',
# Search results
'searchresults' => 'Výsledky vyhľadávania',
'disambiguationspage' => 'Template:Rozlišovacia stránka',
'disambiguations-text' => "Nasledovné stránky odkazujú na '''rozlišovaciu stránku'''.
Mali by však odkazovať priamo na príslušnú tému.<br />
-Stránka sa považuje za rozlišovaciu, keď používa šablónu, na ktorú odkazuje [[MediaWiki:Disambiguationspage]]",
+Stránka sa považuje za rozlišovaciu, keď používa šablónu, na ktorú odkazuje [[MediaWiki:Disambiguationspage]].",
'doubleredirects' => 'Dvojité presmerovania',
'doubleredirectstext' => 'Táto stránka obsahuje zoznam stránok, ktoré presmerovávajú na iné presmerovacie stránky.
'duration-millennia' => '$1 {{PLURAL:$1|tisočletje|tisočletji|tisočletja|tisočletij}}',
# Unknown messages
-'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|ni dovoljena datotečna vrsta|nista dovoljeni datotečni vrsti|niso dovoljene datotečne vrste}}. {{PLURAL:$3|Dovoljena datotečna vrsta je|Dovoljeni datotečni vrsti sta|Dovoljene datotečne vrste so|Dovoljene datotečne vrste so}} $2.',
+'api-error-filetype-banned-type' => '$1 {{PLURAL:$4|ni dovoljena datotečna vrsta|nista dovoljeni datotečni vrsti|niso dovoljene datotečne vrste}}. {{PLURAL:$3|Dovoljena datotečna vrsta je|Dovoljeni datotečni vrsti sta|Dovoljene datotečne vrste so}} $2.',
);
'duration-millennia' => '$1 {{PLURAL:$1|milenyo|mga milenyo}}',
# Unknown messages
-'api-error-filetype-banned-type' => 'Ang $1 {{PLURAL:$4|ay isang hindi pinapahintulutang uri ng talaksan|ay mga hindi pinapahintulutang mga uri ng talaksan}}. Ang mga pinapayagang {{PLURAL:$3|uri ng talaksan ay ang|mga uri ng talaksan ay ang mga}} $2.',
+'api-error-filetype-banned-type' => 'Ang $1 {{PLURAL:$4|ay isang hindi pinapahintulutang uri ng talaksan|ay hindi pinapahintulutang mga uri ng talaksan}}. Ang pinapayagang {{PLURAL:$3|uri ng talaksan ay ang|mga uri ng talaksan ay ang mga}} $2.',
);
'badaccess-groups' => '您刚才请求的操作只有{{PLURAL:$2|这个用户组|以下用户组}}中的用户才能使用: $1',
'versionrequired' => '需要版本为$1的MediaWiki',
-'versionrequiredtext' => '需要版本为$1的MediaWiki才能使用本页。请见[[Special:Version|版本页面]]。',
+'versionrequiredtext' => '需要版本为$1的MediaWiki才能使用本页。
+请见[[Special:Version|版本页面]]。',
'ok' => '确定',
'retrievedfrom' => '来自“$1”',
'tog-underline' => '連結加底線:',
'tog-justify' => '段落對齊',
'tog-hideminor' => '最近更改中隱藏小修改',
-'tog-hidepatrolled' => 'æ\96¼æ\9c\80è¿\91æ\9b´æ\94¹ä¸é\9a±è\97\8få·¡æ\9f¥é\81\8eç\9a\84編輯',
-'tog-newpageshidepatrolled' => 'æ\96¼æ\96°é \81é\9d¢æ¸\85å\96®ä¸é\9a±è\97\8få·¡æ\9f¥é\81\8eç\9a\84é \81é\9d¢',
+'tog-hidepatrolled' => '最近更改中隱藏巡查過的編輯',
+'tog-newpageshidepatrolled' => '新頁面清單中隱藏巡查過的頁面',
'tog-extendwatchlist' => '展開監視清單以顯示所有更改,不只是最近的',
'tog-usenewrc' => '在最近更改和監視列表中整合同一頁的修改 (需要JavaScript)',
'tog-numberheadings' => '標題自動編號',
'tog-watchdeletion' => '將我刪除的頁面和檔案添加到我的監視列表',
'tog-minordefault' => '預設將編輯設定為小編輯',
'tog-previewontop' => '在編輯框上方顯示預覽',
-'tog-previewonfirst' => '第一次編輯時顯示原文內容的預覽',
+'tog-previewonfirst' => '第一次編輯時顯示預覽',
'tog-nocache' => '禁止瀏覽器頁面快取',
'tog-enotifwatchlistpages' => '當在我的監視列表中的頁面或檔案改變時發電子郵件給我',
-'tog-enotifusertalkpages' => '當我的對話頁發生改變時發電子郵件給我',
+'tog-enotifusertalkpages' => '當我的對話頁更改時發電子郵件給我',
'tog-enotifminoredits' => '即使是頁面和檔案的小修改也向我發電子郵件',
'tog-enotifrevealaddr' => '在通知電子郵件中顯示我的電子郵件位址',
'tog-shownumberswatching' => '顯示監視用戶的數目',
'tog-watchlisthidepatrolled' => '監視清單中隱藏已巡查的編輯',
'tog-nolangconversion' => '不進行用字轉換',
'tog-ccmeonemails' => '當我寄電子郵件給其他用戶時,也寄一份複本到我的信箱。',
-'tog-diffonly' => '在比較兩個修訂版本差異時不顯示頁面內容',
+'tog-diffonly' => '比較版本差異時不顯示頁面內容',
'tog-showhiddencats' => '顯示隱藏分類',
'tog-noconvertlink' => '不轉換連結標題',
'tog-norollbackdiff' => '進行回退後略過差異比較',
'viewtalkpage' => '檢視討論頁面',
'otherlanguages' => '其他語言',
'redirectedfrom' => '(重定向自$1)',
-'redirectpagesub' => '重定向頁面',
+'redirectpagesub' => '重定向頁',
'lastmodifiedat' => '此頁面最後修訂於 $1 $2。',
'viewcount' => '本頁面已經被瀏覽$1次。',
'protectedpage' => '受保護頁面',
'jumpto' => '跳轉到:',
'jumptonavigation' => '導覽',
'jumptosearch' => '搜尋',
-'view-pool-error' => '抱歉,伺服器在這段時間中已經超出負荷。
-太多用戶嘗試檢視這個頁面。
-在嘗試訪問這個頁面之前請再稍等一會。
+'view-pool-error' => '抱歉,現時伺服器已超出負荷。
+太多用戶正嘗試檢視此頁。
+請稍等一會後再次訪問此頁。
$1',
'pool-timeout' => '等待鎖死時超時',
'mainpage' => '首頁',
'mainpage-description' => '首頁',
'policy-url' => 'Project:方針',
-'portal' => '社群入口',
+'portal' => '社群主頁',
'portal-url' => 'Project:社區主頁',
'privacy' => '隱私權政策',
'privacypage' => 'Project:隱私權政策',
'badaccess-groups' => '您剛才的請求只有{{PLURAL:$2|這個|這些}}用戶組的用戶才能使用:$1',
'versionrequired' => '需要MediaWiki $1 版',
-'versionrequiredtext' => '需要版本$1的 MediaWiki 才能使用此頁。參見[[Special:Version|版本頁]]。',
+'versionrequiredtext' => '需要版本$1的 MediaWiki 才能使用此頁。
+參見[[Special:Version|版本頁]]。',
'ok' => '確定',
'retrievedfrom' => '取自「$1」',
'youhavenewmessages' => '您有$1($2)。',
'newmessageslink' => '新訊息',
-'newmessagesdifflink' => '上次更改',
+'newmessagesdifflink' => '最後更改',
'youhavenewmessagesmulti' => '您在 $1 有一條新訊息',
'editsection' => '編輯',
'editold' => '編輯',
'nstab-mediawiki' => '訊息',
'nstab-template' => '模板',
'nstab-help' => '幫助頁面',
-'nstab-category' => '類別',
+'nstab-category' => '分類',
# Main script and global functions
'nosuchaction' => '這個命令不存在',
<blockquote><tt>$1</tt></blockquote>
來自於函數 "<tt>$2</tt>"。
數據庫返回錯誤 "<tt>$3: $4</tt>"。',
-'dberrortextcl' => '發生了一個資料庫查詢語法錯誤。
+'dberrortextcl' => '發生資料庫查詢語法錯誤。
最後一次的資料庫查詢是:
「$1」
來自於函數「$2」。
'duration-millennia' => '$1千年',
# Unknown messages
-'api-error-filetype-banned-type' => '$1{{PLURAL:$4|不是允許的檔案類型|是不允許的檔案類型}}。 允許的{{PLURAL:$3|檔案類型|檔案類型}} $2。',
+'api-error-filetype-banned-type' => '$1{{PLURAL:$4|不是允許的檔案類型|不是允許的檔案類型}}。 允許的{{PLURAL:$3|檔案類型是|檔案類型是}} $2。',
);
'youhavenewmessages',
'newmessageslink',
'newmessagesdifflink',
+ 'youhavenewmessagesfromusers',
+ 'youhavenewmessagesmanyusers',
+ 'newmessageslinkplural',
+ 'newmessagesdifflinkplural',
'youhavenewmessagesmulti',
'newtalkseparator',
'editsection',
'expansion-depth-exceeded-warning',
'parser-unstrip-loop-warning',
'parser-unstrip-recursion-limit',
+ 'converter-manual-rule-error',
),
'undo' => array(
'undo-success',
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
* @author Rob Church <robchur@gmail.com>
* @licence GNU General Public Licence 2.0 or later
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that reassigns edits from a user or IP address
+ * to another user.
+ *
+ * @ingroup Maintenance
+ */
class ReassignEdits extends Maintenance {
public function __construct() {
parent::__construct();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that builds file cache for content pages.
+ *
+ * @ingroup Maintenance
+ */
class RebuildFileCache extends Maintenance {
public function __construct() {
parent::__construct();
foreach ( $res as $row ) {
$rebuilt = false;
$wgRequestTime = microtime( true ); # bug 22852
-
+
$wgTitle = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
if ( null == $wgTitle ) {
$this->output( "Page {$row->page_id} has bad title\n" );
<?php
/**
- * Script to update image metadata records
+ * Update image metadata records.
*
* Usage: php rebuildImages.php [--missing] [--dry-run]
* Options:
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script to update image metadata records.
+ *
+ * @ingroup Maintenance
+ */
class ImageBuilder extends Maintenance {
/**
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script to rebuild the localisation cache.
+ *
+ * @ingroup Maintenance
+ */
class RebuildLocalisationCache extends Maintenance {
public function __construct() {
parent::__construct();
$this->mDescription = "Rebuild the localisation cache";
$this->addOption( 'force', 'Rebuild all files, even ones not out of date' );
$this->addOption( 'threads', 'Fork more than one thread', false, true );
- $this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)',
+ $this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)',
false, true );
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that rebuilds link tracking tables from scratch.
+ *
+ * @ingroup Maintenance
+ */
class RebuildAll extends Maintenance {
public function __construct() {
parent::__construct();
<?php
/**
- * This script purges all language messages from the cache
+ * Purge all languages from the message cache.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that purges all languages from the message cache.
+ *
+ * @ingroup Maintenance
+ */
class RebuildMessages extends Maintenance {
public function __construct() {
parent::__construct();
<?php
/**
- * Rebuild link tracking tables from scratch. This takes several
- * hours, depending on the database size and server configuration.
+ * Rebuild recent changes from scratch. This takes several hours,
+ * depending on the database size and server configuration.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
* @todo Document
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that rebuilds recent changes from scratch.
+ *
+ * @ingroup Maintenance
+ */
class RebuildRecentchanges extends Maintenance {
public function __construct() {
parent::__construct();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
* @todo document
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that rebuilds search index table from scratch.
+ *
+ * @ingroup Maintenance
+ */
class RebuildTextIndex extends Maintenance {
const RTI_CHUNK_SIZE = 500;
<?php
/**
- * Script to refresh image metadata fields. See also rebuildImages.php
+ * Refresh image metadata fields. See also rebuildImages.php
*
* Usage: php refreshImageMetadata.php
*
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script to refresh image metadata fields.
+ *
+ * @ingroup Maintenance
+ */
class RefreshImageMetadata extends Maintenance {
/**
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
* @author Rob Church <robchur@gmail.com>
*/
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
+/**
+ * Maintenance script that removes unused user accounts from the database.
+ *
+ * @ingroup Maintenance
+ */
class RemoveUnusedAccounts extends Maintenance {
public function __construct() {
parent::__construct();
</p>
!! end
+!! test
+Headers with excess '=' characters
+(Are similar tests necessary beyond the 1st level?)
+!! input
+=foo==
+==foo=
+=''italic'' heading==
+==''italic'' heading=
+!! result
+<table id="toc" class="toc"><tr><td><div id="toctitle"><h2>Contents</h2></div>
+<ul>
+<li class="toclevel-1 tocsection-1"><a href="#foo.3D"><span class="tocnumber">1</span> <span class="toctext">foo=</span></a></li>
+<li class="toclevel-1 tocsection-2"><a href="#.3Dfoo"><span class="tocnumber">2</span> <span class="toctext">=foo</span></a></li>
+<li class="toclevel-1 tocsection-3"><a href="#italic_heading.3D"><span class="tocnumber">3</span> <span class="toctext"><i>italic</i> heading=</span></a></li>
+<li class="toclevel-1 tocsection-4"><a href="#.3Ditalic_heading"><span class="tocnumber">4</span> <span class="toctext">=<i>italic</i> heading</span></a></li>
+</ul>
+</td></tr></table>
+<h1><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=1" title="Edit section: foo=">edit</a>]</span> <span class="mw-headline" id="foo.3D">foo=</span></h1>
+<h1><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=2" title="Edit section: =foo">edit</a>]</span> <span class="mw-headline" id=".3Dfoo">=foo</span></h1>
+<h1><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=3" title="Edit section: italic heading=">edit</a>]</span> <span class="mw-headline" id="italic_heading.3D"><i>italic</i> heading=</span></h1>
+<h1><span class="editsection">[<a href="/index.php?title=Parser_test&action=edit&section=4" title="Edit section: =italic heading">edit</a>]</span> <span class="mw-headline" id=".3Ditalic_heading">=<i>italic</i> heading</span></h1>
+
+!! end
+
!! test
BUG 1219 URL next to image (broken)
!! input
$idField = $isSqlite ? 'INTEGER' : 'INT unsigned';
$primaryKey = $isSqlite ? 'PRIMARY KEY AUTOINCREMENT' : 'auto_increment PRIMARY KEY';
- $dbw->safeQuery(
+ $dbw->query(
'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
test_id ' . $idField . ' NOT NULL ' . $primaryKey . ',
test_name VARCHAR(255) NOT NULL,
QUnit.module( 'mediawiki.api.parse', QUnit.newMwEnvironment() );
-QUnit.asyncTest( 'Simple', function ( assert ) {
+QUnit.asyncTest( 'Hello world', function ( assert ) {
var api;
- QUnit.expect( 1 );
+ QUnit.expect( 6 );
api = new mw.Api();
api.parse( "'''Hello world'''" )
.done( function ( html ) {
- // Html also contains "NewPP report", so only check the first part
- assert.equal( html.substr( 0, 25 ), '<p><b>Hello world</b></p>',
- 'Wikitext to html parsing works.'
- );
+ // Parse into a document fragment instead of comparing HTML, due to
+ // presence of Tidy influencing whitespace.
+ // Html also contains "NewPP report" comment.
+ var $res = $( '<div>' ).html( html ).children(),
+ res = $res.get( 0 );
+ assert.equal( $res.length, 1, 'Response contains 1 element' );
+ assert.equal( res.nodeName.toLowerCase(), 'p', 'Response is a paragraph' );
+ assert.equal( $res.children().length, 1, 'Response has 1 child element' );
+ assert.equal( $res.children().get( 0 ).nodeName.toLowerCase(), 'b', 'Child element is a bold tag' );
+ // Trim since Tidy may or may not mess with the spacing here
+ assert.equal( $.trim( $res.text() ), 'Hello world', 'Response contains given text' );
+ assert.equal( $res.find( 'b' ).text(), 'Hello world', 'Bold tag wraps the entire, same, text' );
QUnit.start();
});